Author Topic: Weird thing with Microsoft SAPI  (Read 648 times)

gonz23

  • Posts: 22
Weird thing with Microsoft SAPI
« on: 23 Dec '17 - 16:32 »
Hello. My problem is not BASS related, but audio related, but as this forum is very helping I post it here, in case anyone knows something about it, because it is something very intriguing.

I'm trying to implement a chat between two people with Microsoft Text to Speech in Windows 10 with Delphi, and trying that one voice sounds in the left channel and the other one in the right. I read something about IAudioEndPointVolume but I thought that for starting WaveOutSetVolume would be simpler. And in the beginning it worked flawlessly, I first took the current volume with WaveOutGetVolume, then set only the left channel volume, speak one people and then the other channel and people, and finally restoring the master stereo volume.

But in some point the app crashed with an error, and after solving that error that I don't remember which was, but it wasn't related with this problem, but happened when this kind of dialogue was taking effect, after that all the voices I try in this app in particular sound only through the left channel. If I try the same voice in another app, it sounds right in stereo. This happened with the AV-receiver audio device as default. If I change to the speakers device my app sounds well in stereo too, but returning to the AV-receiver it sounds again in the left channel. The curious thing is that if I make a copy, file per file, all the same of all the app folder in another folder, the same app sounds well in stereo with the AV-receiver. I've even reinstalled Nvidia drivers with a correct (default) setup, and the thing persists. Of course windows restarting does nothing.

I can't only think that the crashing did something in the Microsoft speech engine that is stored anywhere that is pointing to the app folder. I'm afraid that I'll have to study the IAudioEndPointVolume stuff but if anyone knows what can be happening, thank you very much.

saga

  • Posts: 2267
Re: Weird thing with Microsoft SAPI
« Reply #1 on: 23 Dec '17 - 17:16 »
What you observed is that Windows remembers all volume options per application (identified by its executable name) and per device; You need to go to the Windows mixer and reset the options for your application there while it's running. One good example why you absolutely shouldn't solve a problem like this on the sound device level.

gonz23

  • Posts: 22
Re: Weird thing with Microsoft SAPI
« Reply #2 on: 23 Dec '17 - 18:33 »
Ok thank you very much. I guess the issue wouldn't happen with IAudioEndPointVolume, cheers.