mirror of
https://github.com/koel/koel
synced 2024-12-21 01:53:11 +00:00
2.1 KiB
2.1 KiB
Streaming Music
Streaming Methods
Koel supports three streaming methods which can be configured via the STREAMING_METHOD
setting in .env
file:
php
: Use native PHPreadfile()
. This is the default method, and the slowest and most unstable one.x-accel-redirect
: Use nginx's X-Accel module, designed for serving larger contents directly to the end user. Refer tonginx.conf.example
for a sample nginx configuration file.x-sendfile
: Use Apache's mod_xsendfile module. You'll need to install and configure the module manually. A sample configuration is as following:
Note that although its home page denotes "Apache2/Apache2.2," the module itself is known to work with later versions of Apache as well. :::tip Tip If you're using Koel mobile app and can't play the songs, try switching the streaming method toLoadModule xsendfile_module libexec/apache2/mod_xsendfile.so # These configuration can be put in the VirtualHost directive as well <IfModule mod_xsendfile.c> XSendFile on XSendFilePath /mnt/media </IfModule>
x-accel-redirect
orx-sendfile
instead ofphp
. :::
:::warning Notice
STREAMING_METHOD
doesn't have effects if you're transcoding or streaming from a cloud storage.
:::
Transcoding FLAC
Koel supports transcoding FLAC to mp3 on the fly when streaming music. This behavior can be controlled via a TRANSCODE_FLAC
setting in .env
file:
false
: Disable FLAC transcoding. Koel will stream FLAC files as-is, producing the lossless audio quality. This is the default behavior.true
: Enable FLAC transcoding. Koel will transcode FLAC to mp3 on the fly. You'll need to have FFmpeg installed on your server and set its executable path via theFFMPEG_PATH
setting in the.env
file. The transcoding quality can also be controlled viaOUTPUT_BIT_RATE
(defaults to128
).