×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Aug 2007
    Posts
    105

    Play continuous sound with varying frequency

    Hi all,

    I've got a problem here: I'd like to play a continuous sound with varying frequency without stopping the playback when changing the frequency. Is this possible? I've tried CoeSoundPlayer and CMdaAudioToneUtility, but both have to stop the old tone playing before being able to start a new one.

    Thanks a lot,

    Chris

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Play continuous sound with varying frequency

    What about stream players, I quess it would play as soon as you send buffers to it ..

  3. #3
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Play continuous sound with varying frequency

    Yes, you could potentially generate PCM sample data of varying frequencies dynamically and play them with CMdaAudioOutputStream.

    In fact, apart from dynamic MIDI, that might be the only way to do it. There is a CMidiClientUtility that should do exactly what you want. It's not the easiest class to use though.

    Sorcery

  4. #4
    Regular Contributor
    Join Date
    Aug 2007
    Posts
    105

    Re: Play continuous sound with varying frequency

    I think I can't use streaming, as I would then have to know how long each tone should be played beforehand, which I don't. But the midi client looks exactly like what I'm looking for. Now, i tried
    Code:
    CMidiClientUtility* midi=CMidiClientUtility::NewL(*this);
    CleanupStack::PushL(midi);
    TTimeIntervalMicroSeconds duration(1000000);
    midi->PlayNoteL(1, 60, duration, 64, 64) //play middle C on channel 1 for 1 second at average velocity.
    CleanupStack::PopAndDestroy();
    but to no avail.
    Code:
    iMidi=CMidiClientUtility::NewL(*this);
    TInt numBanks=iMidi->NumberOfBanksL(EFalse);
    TInt bankId=iMidi->GetBankIdL(EFalse,0);
    gives me numBanks=1 and a -5 error (KErrNotSupported) on the GetBankIdL() line. Do I need the MultimediaDD capability? Some Nokia FAQ site stated, it would only be needed if i increased the priority. Do you have some hints or an example for me?

    Thanks a lot,

    Chris

  5. #5
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Play continuous sound with varying frequency

    Hi,

    I told you it wasn't very easy to use.

    Make sure you implement the observer class methods to check if you are getting any errors that way.

    I haven't looked at this for a long time, but I think the biggest problem is that MIDI isn't supported on the emulator, only actual devices. Are you trying it on the emulator?

    I believe there is only one instrument bank and thus you can't change it (although possibly you could if you loaded a custom bank first). Was there some documentation that led you to believe you needed to set the bank?

    You shouldn't need MultimediaDD.

    Sorcery

Similar Threads

  1. use CMdaAudioPlayerUtility play sound
    By HellenZ in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2010-02-22, 15:15
  2. Play one sound after another
    By remoto in forum Symbian
    Replies: 7
    Last Post: 2008-08-30, 18:43
  3. Cannot play mid and wav sound at the same time on Nokia N96.
    By Ishnu_Blue in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2008-08-26, 11:14
  4. Nokia Smart Expert - solve this sound problem
    By tsoh_tan in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-10-30, 04:36

Posting Permissions

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