## StockAudioPlayer sometimes loses audio during an RDP session

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

### StockAudioPlayer sometimes loses audio during an RDP session

I don’t think this is a problem specifically with the TStockAudioPlayer component, but I’m hoping someone here might have an idea to help me solve this. Sometimes my program simply stops playing the audio at the local computer when running as an RDP client on a Windows terminal server. It’s not a question of having the RDP enabled for remote audio, because most of the time it works, and I don’t think the connection from the client to the server is the problem either, because the program works fine in every respect except for the audio. It never loses audio while it's playing a file, only when a new file is selected to play. And I've never observed the problem running it locally (not as an RDP session). The terminal servers are all Windows 2008 boxes, the clients are XP SP3.

Any ideas?
abh
Active Member

Posts: 12
Joined: August 24th, 2012, 10:49 pm

### Re: StockAudioPlayer sometimes loses audio during an RDP ses

Apparently the problem is within that part of the code that receives the audio format of the remote file. I remember that I had the same issue while writing the receiver demo.

Make sure your code reads the entire audio header from the remote machine, otherwise you setup StockAudioPlayer improperly. In a local connection there is no problem because by one read from the socket you receive the audio header completely. However, in case of a remote connection you may need to read from the socket several times until you receive all the bytes of the audio header.
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

### Re: StockAudioPlayer sometimes loses audio during an RDP ses

Thanks Kambiz, but I don't understand your suggestion. This is all my code does:
Code: Select all
           StockAudioPlayer.PlayFile (FFileName);

There is exception processing surrounding this statement, and it's not catching any errors.

What would I have to do to insure the header was completely read? Just to clarify, this is being run under Microsoft's "MSTSC" remote desktop client program, connecting to a terminal server - so the file is actually local to the program. What's remote is the screen, keyboard, and in this case most importantly -- the speakers.
abh
Active Member

Posts: 12
Joined: August 24th, 2012, 10:49 pm

### Re: StockAudioPlayer sometimes loses audio during an RDP ses

Oops! Sorry my mistake!
I didn't pay enough attention and thought you are using TLiveAudioPlayer.
I hove no idea what may caused the problem in this case.
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

### Re: StockAudioPlayer sometimes loses audio during an RDP ses

Thanks for trying! I'm probably going to open a support ticket with Microsoft.
abh
Active Member

Posts: 12
Joined: August 24th, 2012, 10:49 pm

### Re: StockAudioPlayer sometimes loses audio during an RDP ses

No solution here, but sometimes it's nice knowing you're not the only one having a problem.

And this seems to prove that the StockAudioPlayer is not where the problem is.
abh
Active Member

Posts: 12
Joined: August 24th, 2012, 10:49 pm

### Re: StockAudioPlayer sometimes loses audio during an RDP ses

Thanks for the update.
This is a relief!
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

### Who is online

Users browsing this forum: No registered users and 6 guests