Darth Flyeater

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)

  • Author
    Posts
  • Darth Flyeater
    Participant

    I did not ever find a perfect solution. I used Audacity to boost the volume levels of all my sound files. Then, I put the pocket sphinx calibration as one of the first things to get called in the scene (before the instructions track started), so the sound level drop isn’t as noticeable. With the boosted levels of the instructions and other sound tracks, the lowered levels caused by the active listening is overcome.

    Darth Flyeater
    Participant

    I have a background track that starts when the app is launched. There is a toggle button where the user can turn it on or off. I then have an instruction audio track that plays before I have the listening begin. Background sounds and instruction track play at normal volume. When pocket sphinx is calibrated and starts listening, the background track volume is cut at least in half (but continues to play). The active listening works perfectly at that point (even with the background track still playing). I then have kudos audio play if the correct word is recognized. This also works perfectly and doesn’t care if listening is active or suspended (I’ve tried both ways). However, this volume is also reduced. The only way to get the volume back to normal is to exit the app completely and restart. I have an exit button which takes you back to the start scene (which has no listening, just a title and a start button along with the background track still playing), but the volume remains degraded.

    Since other users are reporting that avaudioplayer should work with openears, I think I’ll make a test app with nothing but my background track and openears to see if I can get it to work.

    Darth Flyeater
    Participant

    I have AudioSession as part of the standard PocketSphinx methods:

    – (void) audioSessionInterruptionDidBegin
    {
    NSLog(@”AudioSession interruption began.”);

    [self.pocketsphinxController stopListening]; // React to it by telling Pocketsphinx to stop listening since it will need to restart its loop after an interruption.
    }

    – (void) audioSessionInterruptionDidEnd
    {
    NSLog(@”AudioSession interruption ended.”);

    // We’re restarting the previously-stopped listening loop.
    [self startListening];
    }

    But nothing should be calling those methods.

    And I also tried this: pocketsphinxController.audioSessionMixing = TRUE; in the pocket sphinx lazy initiator method to try and fix the problem with the volume after I noticed it.

    I don’t have any AVAudioSessions.

    I tried killing all the AudioSessions references and my background sound volume control and it still cuts the volume once active listening starts.

    I’m not using FliteController or NeatSpeech. Can I get my sound files to be played thru FliteController?

    I’ll try some of the suggestions on the PlayAndRecord forum posts and see if I can get it to work properly.

    Darth Flyeater
    Participant

    Thanks for the reply, Halle. I’ll take a look at the PlayAndRecord posts.

    I am using AVAudioPlayer for all my sounds/audio and the volume is still getting sacked (unless I’m doing something wrong). Below is my code for the background sounds:

    AVAudioPlayer *_backgroundSoundPlayer; //declared at the top of the implementation

    – (void)playBackgroundSound:(NSString *)filename
    {
    NSError *error;
    NSURL *backgroundSoundURL = [[NSBundle mainBundle] URLForResource:filename withExtension:nil];
    _backgroundSoundPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:backgroundSoundURL error:&error];
    _backgroundSoundPlayer.numberOfLoops = -1;
    _backgroundSoundPlayer.volume = vB;
    [_backgroundSoundPlayer prepareToPlay];
    }

    [_backgroundSoundPlayer play]; //this gets called in another method

    What other workarounds are you looking at, and could I help test them?

    Thanks again.

Viewing 4 posts - 1 through 4 (of 4 total)