Skip to content

🎧 Your Personal Streaming Service

option to disable downsampling

Deluande6bd1eb17b4
diff --git a/conf/app.conf b/conf/app.conf
index 1c0602d32..c4f354736 100644
--- a/conf/app.conf
+++ b/conf/app.conf
@@ -1,4 +1,5 @@
appname = github.com/deluan/gosonic
+serverName = GoSonic
httpPort = 8080
runMode = dev
autoRender = false
@@ -13,19 +14,21 @@ musicFolder=./iTunes1.xml
user=deluan
password=wordpass
dbPath=./devDb
+enableDownsampling = true
downsampleCommand=ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -
plsIgnoreFolders = true
plsIgnoredPatterns = ^iCloud;^CDs para;^Skipped;Christian
[dev]
-disableValidation = true
+disableValidation = false
+enableDownsampling = false
enableAdmin = true
[test]
disableValidation = false
httpPort = 8081
-user=deluan
-password=wordpass
+user = deluan
+password = wordpass
dbPath = /tmp/testDb
-musicFolder=./tests/itunes-library.xml
-downsampleCommand=ffmpeg -i %s -b:a %bk mp3 -
+musicFolder = ./tests/itunes-library.xml
+downsampleCommand = ffmpeg -i %s -b:a %bk mp3 -
diff --git a/engine/stream.go b/engine/stream.go
index 3efd6908d..b53bbe93a 100644
--- a/engine/stream.go
+++ b/engine/stream.go
@@ -14,7 +14,8 @@ import (
func Stream(path string, bitRate int, maxBitRate int, w io.Writer) error {
var f io.Reader
var err error
- if maxBitRate > 0 && bitRate > maxBitRate {
+ ds, _ := beego.AppConfig.Bool("enableDownsampling")
+ if ds && maxBitRate > 0 && bitRate > maxBitRate {
f, err = downsample(path, maxBitRate)
} else {
f, err = os.Open(path)