0

I am trying to build an application in c# visual studio, in which I want to play 2 wav files at certain dB values simultaneously. I looked into many stackoverflow questions but didn't find any useful answers.

My scenario is : before using the application user fill the 2 different dB values for 2 wav files. So I am facing two problems -

  1. I am not able to figure out how to play two wav files on ceratin dB values?
  2. How can I validate that the wav file is being played on the dB value, I provided.

I tried using the WaveChannel32, mediaplayer and Naudio but it didn't help.

Any help will be much appreciated.

Thanks, Robin

Robin Sharma
  • 181
  • 2
  • 11
  • Part of your problem is that you don't really define what it means to "play at a certain dB value". Do you mean the loudest peak would be that level? The average? Some other measure? Second is that you can't really guarantee that because dB level depends on the hardware that is amplifying the sound. For instance, if the user has it hooked to headphones, it's different than if they're playing it through speakers. And what if they're using an amplifier in their speakers to boost sound? – Erik Funkenbusch May 18 '17 at 15:59
  • By "Play at certain dB values" I mean that user has the option to select any dB value between 0 to 100. So lets say user can choose to play one wav file at 70 dB value and second wav file at 65 dB value. Second wav files will be player via speaker only always. As of now no amplifiers in speakers. But If amplifier is there in speaker then what measure should I take? – Robin Sharma May 18 '17 at 16:07
  • I don't really think you understand what a dB value is. It's a measurement of energy, at a specific distance. It's very subjective to the environment you are playing the sound back in. I think you simply want a volume adjustment that is broken into 100 segments (with 100 being the maximum volume the system can produce), which isn't the same thing as dB. – Erik Funkenbusch May 18 '17 at 16:11
  • What's more, are you simply trying to adjust the built-in Windows volume control? Or are you physically trying to alter the waveform amplitude that is sent to the windows output? Audio is actually a pretty complex topic, and it helps if you use the right terminology and know exactly what you're trying to do. – Erik Funkenbusch May 18 '17 at 16:13
  • Well you are right. I don't really have much idea about dB value. From google I found that in c# we can adjust sound based on decimal to decibel values. Maximum sound value is 1f and minimum is 0f . Provided decimal value we can adjust the sound value between 0f to 1f. – Robin Sharma May 18 '17 at 16:19
  • I have speakers connected to the computer and in beginning of application I want to set the speaker volume based on the dB [ decimal ] value given by user. – Robin Sharma May 18 '17 at 16:22

0 Answers0