filoe / cscore

An advanced audio library, written in C#. Provides tons of features. From playing/recording audio to decoding/encoding audio streams/files to processing audio data in realtime (e.g. applying custom effects during playback, create visualizations,...). The possibilities are nearly unlimited.
Other
2.15k stars 451 forks source link

Output Volume different #394

Open NuelGr opened 4 years ago

NuelGr commented 4 years ago

Today i updated from V1.0.0.2 to the latest version.

I noticed that the output volume (when playing MP3s) got way more silent. (Didn't found a changelog)

The volume property description says that it has a range from 0.01 (1%) to 1 (100%).

I was able to set a maximum of 100 now. (Could not do it in the older version). Now 1 in the latest version is the same as 0.01 in the older version. Is this correct and an intended behaviour? If it is intended, maybe update the description of the property.

Second question: If i start my application from a folder which isn't named "Debug" then volume 1-100 sounds like 100%. When i just rename the folder back to "Debug" then volume 1 sounds like 1%. Why does the behaviour change if i rename the folder??

Also if i start the application as release from visual studio, volume 1 is super loud. If i start it as debug, volume 1 is quiet. If i rename this debug folder and just start the exe, volume 1 is super loud again.

Now i don't know what to ship to my customers. Going back to V1.0.0.2 isn't rlly an option. Thank you for helping :)

This is a code-snipped how i play MP3-files. (Using Windows 10, .NET Framework 4.6.2)

_WaveSource = CodecFactory.Instance.GetCodec(filename).ToSampleSource().ToMono().ToWaveSource()
_SoundOut = New WasapiOut() With {
     .Latency = 100,
     .Device = Me.Device
}
_SoundOut.Initialize(_WaveSource)
_SoundOut.Volume = 1
_SoundOut.Play()
filoe commented 4 years ago

What? When the folder is named Debug, the volume is less powerful? The Volume property of WasapiOut translates directly to the VolumeSource. The volume sources just multiplies the samples by the volume. Make sure that there are no presets in the windows mixer. Maybe the windows mixer distinguish the applicates by it's path and for the Debug path there some else volume level.