lihaosky / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

Uncompressed wave files played back too fast #553

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
**What steps will reproduce the problem?**

I created an Android sender app that serves dynamic text-to-speech wave files 
to the Chromecast receiver app through an embedded HTTP server.

The Chromecast receiver app uses an HTML5 audio element to play back the 
dynamically generated uncompressed wave file (sample file is attached to this 
issue).

**What is the expected output? What do you see instead?**

Playback of the generated wave files sounds normal using desktop apps such as 
VLC player, Audacity or Chrome for Linux.

The Chromecast receiver app, on the other hand, plays back the wave file at 
double or triple the normal speed and the resulting speech sounds like a 
chipmunk.

**What version of the product are you using? On what operating system?**
- Text-to-speech files are generated on a Google Nexus 7 running Lollipop
- Chromecast firmware version: 27946
- Android Mediarouter version: v7:21.0.+
- Android Play Services version: 6.5.87
- Cast receiver app library version: 2.0.0

Original issue reported on code.google.com by dev.nobu...@gmail.com on 6 Apr 2015 at 11:25

Attachments:

GoogleCodeExporter commented 9 years ago
I researched this issue a bit more and some people on technical forums about 
Chromecast claim that this may be more an issue with the TV or audio set rather 
than a Chromecast decoding / transcoding problem.

Since the generated wave files are uncompressed PCM streams I guess that 
Chromecast simply passes the raw stream on to the TV. I tested playback on two 
different TVs with the same high pitched result.

If this is in fact a TV audio playback problem is there any bitrate / bit depth 
configuration for uncompressed PCM audio that is safe to play back correctly on 
any TV?

The wave files created by the Android TTS API have the following properties 
(according to shntool):

WAVE format:                  0x0001 (Microsoft PCM)
Channels:                     1
Bits/sample:                  16
Samples/sec:                  22500
Average bytes/sec:            45000
Rate (calculated):            45000
Block align:                  2

Since playback kind of sounds like double the speed and the bit rate of the 
wave file is half CD quality, would doubling the bit rate fix the problem?

Original comment by dev.nobu...@gmail.com on 7 Apr 2015 at 5:16

GoogleCodeExporter commented 9 years ago
Please direct your programming related questions on G+ Chromecast community 
page (https://plus.google.com/communities/115742157569103585450) or on 
StackOverflow with appropriate tag(s) 
(http://stackoverflow.com/tags/google-cast/info). 

Feel free to respond back if you face any issue specific to Cast SDK and we 
will be happy to reopen the ticket for you. 

Original comment by na...@google.com on 7 Apr 2015 at 6:58