Search Results

Search found 3 results on 1 pages for 'audiorecording'.

Page 1/1 | 1 

  • Record/Playback with AudioQueue on iPhone

    - by Biranchi
    Hi, I am currently using Audio Queues on the iPhone to record and playback audio. What I would like to be able to do is to record some audio, allow the user to pause the record queue, and to seek back and forward through the audio to select a position from where they can start recording from again. I have got over the seeking issue by making the playback AudioQueueBuffer sizes small enough so that the play audio queue callback happens at a rate that allows the user to use a slider control to hear the audio as they adjust the slider back and forth. I think I can achieve the recording at a new position by setting the inStartingPacket parameter of the AudioFileWritePackets function that I call from the Audio Recording Queue callback. The trouble is this only inserts audio over the previously recorded audio. The file length obviously doesn't change so if the user were to go backwards and record less audio than before, the old audio still remains after the end of the newly recorded audio. Is there a way I can get the AudioFile to truncate at the point the user starts to insert the new audio, is there some other way I can remove the old audio starting at the insert position or is there a better way about going about this task? Thanks

    Read the article

  • AVAudioPlayer working in Simulator, but not on device

    - by cannyboy
    My mp3 playing code is: NSError *error; soundObject = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:audioPathString] error:&error]; if (soundObject == nil) NSLog(@"%@", [error description]); soundObject.delegate = self; soundObject.numberOfLoops = 0; soundObject.volume = 1.0; NSLog(@"about to play"); [soundObject prepareToPlay]; [soundObject play]; NSLog(@"[soundObject play];"); The mp3 used to play fine, and it still does on the simulator. But not on the device. I've recently added some sound recording code (not mine) to the software. It uses AudioQueue stuff which is slightly beyond me. Does that conflict with AVAudioPlayer? Or what could be the problem? I've noticed that as soon as the audiorecording code starts working, I can't adjust the volume on the device anymore, so maybe it blocks the audio playback?. EDIT The solution seems to be to put this in my code. I put it in applicationDidFinishLaunching: [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayAndRecord error: nil]; UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute,sizeof (audioRouteOverride),&audioRouteOverride); The first line allows both play and record, whilst the other lines apparently reroute things to make the volume louder. All audio code is voodoo to me.

    Read the article

  • Method works on Emulator but no on Microsoft Surface unit?

    - by Roflcoptr
    I have the following code. The StartRecord method trows an error on the Microsoft Surface Unit. But when I'm testing it on the emulator, it all works great. Any hints how 1) to find the exception that is thrown on the Microsoft Surface Unit? 2) to find the error in the code? any assumptions? private void StartRecord(object sender, ContactEventArgs e) { isRecording = true; StartButton.IsEnabled = false; recordTimer = new Timer(10); recordTimer.Elapsed += new ElapsedEventHandler(recordTimer_Elapsed); PlaybackRoot.Visibility = System.Windows.Visibility.Collapsed; EllapsedRecord.Visibility = System.Windows.Visibility.Visible; InputLevel.Visibility = System.Windows.Visibility.Visible; long time = DateTime.Now.Ticks; String fileName = Convert.ToString(time) + ".wav"; Console.WriteLine(fileName); startTime = DateTime.UtcNow; recordTimer.Start(); record = new AudioRecording(fileName); record.getSampleAggregator().MaximumCalculated += new EventHandler<MaxSampleEventArgs>(AudioControl_MaximumCalculated); record.start(); }

    Read the article

1