×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    8

    Streaming audio does not play if too less data

    Hi,

    I am using CMdaAudioOutputStream to stream audio data and it works fine if I call CMdaAudioOutputStream::WriteL() with a descriptor whose length is > 32000. If I call WriteL() with a descriptor whose length is 10976 then MaoscBufferCopied() is called but the data is not played and MaoscPlayComplete() is not called.

    Does anyone have an idea how it is possible to stream also a small amount of data (without using AudioPlayer) ?

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Location
    San Marcos
    Posts
    190
    I am using this method with only a 512 sample buffer and it works fine.
    I based my work off of this article:
    http://newlc.com/article.php3?id_article=113
    Hope this helps you, too.
    Alex

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    8

    Streaming audio does not play if too less data

    I forgot to mention:

    the problem only appears on the phone (3650 or 7650) not on th emulator. On the emulator it works fine whether the data is small or big.

    I have tested using chunks of 512 samples and it does not work either.

  4. #4
    Regular Contributor
    Join Date
    Mar 2003
    Location
    San Marcos
    Posts
    190
    Very strange... maybe you could post a code snippet? I never had problems on the hardware...
    If you like you can download my test case off my website so you can hear for yourself that it works:
    www.hipergames.com then click on symbian game engine.
    You need to install it on the main phone memory (not MMC).
    I am using 512 sample buffer in here and it works fine.
    The only thing I could think is that your other code takes too long to execute, before giving the sound a chance to run. Try taking things that take long out and run it again.
    Alex

  5. #5
    Registered User
    Join Date
    Aug 2003
    Posts
    8
    Finally I got it working. In contrast to the example in http://newlc.com/article.php3?id_article=113 I used a sample rate of 8 kHz. And with 8kHz the buffer has to be 256 samples.

    After all I got the impression that streaming audio in Series 60 is a very sensitive thing. The buffer passed to WriteL does not have to cover more than 32 ms of audio, but it works again with 3000ms. Very strange.

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    16
    I had exactly the same problem on the phone. Samples less than "about 10,000 samples" would fail when using 8khz. I got round this by modifying the code so that it would load a sample then PAD it with 0's to a 'min size' ! At the same time I did like the newlc example and used 8bit samples which got upsized to 16bit.

    -dave-

  7. #7
    Registered User
    Join Date
    Mar 2003
    Posts
    43
    Hi,

    I checekd the article on NewLC on output streaming. I want to develop a voice streaming application. Basically I want to record and store the voice in a file and then play it back. Can you please guide me with some code snippets.

    Thanks in advance,
    Reshma

  8. #8
    Registered User
    Join Date
    Mar 2003
    Posts
    2
    I solved the problem with short buffers not playing by sending a buffer of zero length as the last buffer to play.

  9. #9
    Registered User
    Join Date
    Mar 2003
    Posts
    43
    Hi Asoltan,

    Could you please let me know the approach you have followed?

    Thanks in advance,
    Reshma

  10. #10
    Registered User
    Join Date
    Apr 2004
    Posts
    14
    Hi,

    I need an example of something like playing 2 sound files one after another with no gaps!

    Anyone!???

  11. #11
    Registered User
    Join Date
    Aug 2003
    Posts
    8
    Hi,

    after having a lot of problems with this topic I finally merge the 2 sound files in memory and play them with CMdaAudioPlayerUtility. This class can also play files from memory.

    Regards

    Holger

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×