Wave format

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

Wave format

Postby PatD » October 18th, 2006, 4:31 pm

My application is developped with C++Builder 6.
I use a TTS software that generates wave data buffers. I've implemented a TLiveAudioPlayer object. I pass the wave buffers to it using the OnDataPtr event. Everything seems ok, the buffers are accepted by the component. But I hear nothing on the head speakers.
I tried your client and server samples and everything is ok.
I supposed with is a problem with the wave format, so I've written a very simple application that uses a TLiveAudioRecord. All the received buffers are sent one by one to the TLiveAudioPlayer object. The wave formats specified in the IDE for both objects are the same.
Any idea ?
PatD
Active Member
Active Member
 
Posts: 8
Joined: October 18th, 2006, 4:19 pm

Postby Kambiz » October 18th, 2006, 4:45 pm

Besides OnDataPtr, did you handle OnFormat event properly?

TTS engines usually use none-PCM wave format as default for the output wave.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby PatD » October 18th, 2006, 5:02 pm

Here is a very simple unit that shows the problem. By clicking on the Record button, we start to record and all the buffers are sent to the TLiveAudioPlayer object. Nothing is heared and the OnDataPtr is fired very slowly.

To generate the module using C++Builder 6, simply create a new application in the directory where was extracted the files attached to this post, remove the Unit1.cpp from the project and add srcmain.cpp.

Thanks for your help.
Attachments
Simple.zip
(2.16 KiB) Downloaded 227 times
PatD
Active Member
Active Member
 
Posts: 8
Joined: October 18th, 2006, 4:19 pm

Postby Kambiz » October 18th, 2006, 5:45 pm

I don't havd BCB to run your code, sorry. Anyway, here are some hints:

1) remove free(ptBfr); at line 79 in pPlayDataPtr event. Setting FreeIt to True will release the memory when it is no more needed.

2) Is your soundcard full-duplex? You can examine it using TAudioRedirector.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 2 guests

cron