Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-13-2008, 07:12 PM   #1 (permalink)
New Member
 
Join Date: Oct 2008
Posts: 14
Default Record sound in compressed format

I would like to modify the SpeakHere to record the file in a compressed format, and Apple released a tech note recently in order to do that but I cannot get it to work despite following instructions to the letter.

Also be careful the // make sure the audio session is active before asking for properties comment means you need to move some initialization code from the recOrStop method to the initwithnibname part - i did that.

has anyone had success modifying the example to record in an
IMA/ADPCM (aka IMA4) - kAudioFormatAppleIMA4 or similar?

Technical Q&A QA1615 - "Audio Queue - Recording to a compressed audio format."

proposed change:
SpeakHere - initWithURL: in AudioRecorder.m:

Code:
- (id) initWithURL: fileURL {
    NSLog (@"initializing a recorder object.");
    self = [super init];

    if (self != nil) {

        // define the audio stream basic description for the file to record into

        // record audio at the current hardware sample rate
        // make sure the audio session is active before asking for properties
        UInt32 propertySize = sizeof(audioFormat.mSampleRate);
        AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareSampleRate,
                                &propertySize,
                                &audioFormat.mSampleRate);

        audioFormat.mFormatID           = kAudioFormatAppleIMA4; // record using IMA4 codec
        audioFormat.mChannelsPerFrame   = 1;

        AudioQueueNewInput(&audioFormat, ... );

        ...

    }

    return self;
}

Last edited by Alex.be; 11-13-2008 at 07:23 PM.
Alex.be is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,769
Threads: 89,202
Posts: 380,577
Top Poster: BrianSlick (7,129)
Welcome to our newest member, hpnotebooo
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:14 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0