LiveAudioPlayer playing a stream

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

LiveAudioPlayer playing a stream

Postby cozturk » October 31st, 2005, 3:13 pm

BufferInternally: Boolean;
If this property is True, the component allocates the memory required for the audio buffers and generates OnData events to fill them. If this property is False, the component generates OnDataPtr events to get audio buffers provided by the application.


I have a live stream which coming from any hardware.
The hardware is not a real sound card.
But wave stream stands in memory.

How can I indicate this streeam to LiveAudioPlayer to live playing ?

I see Perfect looping possible? topic. not clear for me :oops:
http://www.delphiarea.com/forum/viewtop ... =1203#1203
Last edited by cozturk on October 31st, 2005, 4:27 pm, edited 2 times in total.
cozturk
Moderator
Moderator
 
Posts: 63
Joined: June 30th, 2005, 5:39 am
Location: Istanbul - Turkiye

Postby Kambiz » October 31st, 2005, 4:19 pm

You can use OnDataPtr event for this purpose.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby cozturk » November 14th, 2005, 4:38 pm

I modified Live Audio example to playing my live streams which are coming from my sound card like hardware.

live playing not perfect as original Live Audio example which uses LiveAudioRecorder(mic input) to speaker output. Original example realy works perfectly.

The problem is short interrupting between sending live streams. (for example every seconds according to stream size) Original receiver project used withoud modifiying.

Which points must be considered to solving this problem? How can I simulate LiveAudioRecorder to get data and send to clients without interrupting?
cozturk
Moderator
Moderator
 
Posts: 63
Joined: June 30th, 2005, 5:39 am
Location: Istanbul - Turkiye

Postby Kambiz » November 14th, 2005, 8:01 pm

Small BufferLength (~50ms) and Large BufferCount (~10)
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby cozturk » November 17th, 2005, 7:46 am

Image
Thank you.

I have a little problem again :oops: :
Broadcaster stream size shortened about 50ms or less.
Receiver buflen 400, bufcount 10.

After tcpClient.Active := True; on receiver
first 3-5 second interrupts occurs. And between interrupts will increased
.... and no problem after 10seconds.

sample received data attached as wav: http://s6.ultrashare.net/hosting/fs/834fb5b91f4c3708/
PS: No acoustic feedback occured while recording this...
cozturk
Moderator
Moderator
 
Posts: 63
Joined: June 30th, 2005, 5:39 am
Location: Istanbul - Turkiye

Postby Kambiz » November 17th, 2005, 10:19 am

Sorry, I can't help you. I don't have enough exprience in network programming.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby cozturk » November 17th, 2005, 2:36 pm

Excuse me,

May I ask some questions again?:
I think this problem is coming from TAudioBuffer .
Code: Select all
function TAudioBuffer.BeginUpdate(ExtraSize: Cardinal): Pointer;
begin
  EnterCriticalSection(CS);
  ReallocMem(Data, Size + ExtraSize);
  Result := Pointer(Cardinal(Data) + Size);
  Inc(Size, ExtraSize);
end;


Size wil be larger time by time... and will be enough after 10 secs?
Unfortunately I dont understand theese: TAudioBuffer.BeginUpdate, EnterCriticalSection(CS),LeaveCriticalSection(CS)...
and
What happens in AudioBuffer.?
After creating buffersize is small and bigger later?
cozturk
Moderator
Moderator
 
Posts: 63
Joined: June 30th, 2005, 5:39 am
Location: Istanbul - Turkiye

Postby Kambiz » November 17th, 2005, 3:51 pm

The Get method of TAudioBuffer resets the data buffer.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby cozturk » November 21st, 2005, 11:44 am

problem reason was only, my broadcaster sending mechanism. Some delays while sending streams caused this problem .
cozturk
Moderator
Moderator
 
Posts: 63
Joined: June 30th, 2005, 5:39 am
Location: Istanbul - Turkiye

Postby Kambiz » November 21st, 2005, 2:20 pm

Nice to hear you resolved the problem.
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