Recording OpenEars Audio Input to File

Home Forums OpenEars Recording OpenEars Audio Input to File

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

  • Author
    Posts
  • #13054
    Lann
    Participant

    Hello, I have OpenEars working in my application but desperately need to record the audio to file. Any example of how to do this would be helpful. Here is the approach I have tried so far which does not work:

    ContinuousModel.mm (Line 1322) :

    NSUInteger dataLength = [wavData length];
    SInt16 *wavSamples = (SInt16*)malloc(dataLength);
    memcpy(wavSamples, [wavData bytes], dataLength);

    /***** WRITE The WAV DATA TO FILE ******/
    NSLog(@”Writing to file”);

    NSFileHandle *file;
    NSMutableData *data;

    data = [NSMutableData dataWithBytes:wavSamples length:dataLength];

    file = [NSFileHandle fileHandleForWritingAtPath: @”/tmp/quickfox.wav”];

    if (file == nil)
    NSLog(@”Failed to open file”);

    [file writeData: data];
    [file closeFile];
    [file release];
    /**************************************/

    I have started a stackoverflow.com question for this as well: http://stackoverflow.com/questions/13427619/openears-how-to-record-audio-data-to-file

    #13066
    Halle Winkler
    Politepix

    Hello,

    Maybe SaveThatWave does what you’d like: https://www.politepix.com/shop/savethatwavedemo. It wraps up starting/stopping non-blocking WAV saving from incoming speech, and notifications that the file was recorded with the path to the recording as part of the notification, handles logic for suspending/resuming and other corner cases, and wraps up deleting a single recording and deleting all recordings. You can use the tutorial tool to integrate it very easily: https://www.politepix.com/openears/tutorial

    #13111
    Lann
    Participant

    Halle, it does, and you are a sexy man! This is exactly what i was looking for. I am getting an error during installation that pocketsphinxController.outputAudio is undefined. I’m not sure how to tell which version of OpenEars i’m running. This may be a huge problem for me because I have somewhat heavily modified OpenEars for my project and it may have been based on a version that does not have this method.

    #13112
    Halle Winkler
    Politepix

    Right, you’ll need at least version 1.2 for plugin compatibility. Can you download current version 1.2.4, diff your customizations and reintegrate them into it? There are a few nice additions and fixes since the version you must be working with, so it’s probably worthwhile.

    Generally the version can be found in the OpenEars.xcodeproj source files in the comments at the top, and in a file called Version.txt in the root of the OpenEars directory. Since 1.2 it is also shown in the manual and in OpenEarsLogging.

    #14831
    Lann
    Participant

    When attempting to link the SaveThatWaveDemo I get the following linker error:

    “_input_sample_rate”, referenced from:
    -[SaveThatWaveController bufferIsAvailable:] in SaveThatWaveDemo(SaveThatWaveController.o)
    -[SaveThatWaveController pocketsphinxDidDetectFinishedSpeech] in SaveThatWaveDemo(SaveThatWaveController.o)

    This seems to be a valid error since the variable in OpenEars 1.2.4 is actually called “input_sample_rate”.

    Could you please provide a new binary for SaveThatWaveController.o?

    #14833
    Halle Winkler
    Politepix

    The underscore is part of the linker reporting, it isn’t related to the binary which definitely works with the current version of OpenEars.

    This is an normal issue with installing the plugin — can you make sure that you’ve followed all of the steps in the tutorial at https://www.politepix.com/openears/tutorial including adding the -ObjC linker flag in the right place and making sure that your project isn’t still linked to an old version of OpenEars?

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.