Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recording in Fast-Forward mode #152

Closed
swaroopbutala opened this issue Apr 29, 2015 · 12 comments
Closed

Recording in Fast-Forward mode #152

swaroopbutala opened this issue Apr 29, 2015 · 12 comments

Comments

@swaroopbutala
Copy link

Hello @syedhali ,

Thanks for writing this library! I am seeing interesting behavior in my app. For the most part the library works like a charm when I am recording audio using the library. But at times (may be 1/10) it records audio in fast forward mode. So if I think I have recorded 30 secs, it actually records it in ~2x speed, so my output audio is ~15 secs.

I tried a whole bunch of debugging but am not able to figure out what the issue could be. Have you ever seen such behavior? Thoughts?

@ogoldfinger
Copy link

I'm seeing the same thing! Although to me it's more like 1/100. I think the issue is memory related but I can't reliably reproduce to know for sure.

@syedhali
Copy link
Owner

Hey guys, sorry I've been away. I'm slowly refactoring EZAudio on the play_file_cleanup branch, but I don't think any of that involves a fix for this. Though, it sounds like a mismatch between sample rates, can you verify the AudioStreamBasicDescription on the EZOutput and EZMicrophone is the same? Also, is this iOS or Mac?

@ogoldfinger
Copy link

This is iOS for me. I'm playing it back with an AVAudioPlayer though. This is how I'm setting up the recorder with mic. Anything else you'd want to see that could help?

self.ezrecorder = [EZRecorder recorderWithDestinationURL:recordingPath
                                               sourceFormat:self.ezmicrophone.audioStreamBasicDescription
                                        destinationFileType:EZRecorderFileTypeM4A];

@syedhali
Copy link
Owner

Ok, is it happening on the actual device or simulator or both kinda equally?

@ogoldfinger
Copy link

Definitely devices and I've been able to repro in sim as well.

@swaroopbutala
Copy link
Author

Thanks @syedhali

Same for me too. I am working on iOS, I am using swift though. For me it happens only on phone, never seen happen on simulator.

I am not really using EZOutput anywhere though. I followed https://github.com/syedhali/EZAudio/tree/master/EZAudioExamples/iOS/EZAudioRecordExample

Here is how I create my recorder.

self.recorder = EZRecorder(destinationURL: recordingFileUrl, sourceFormat: self.microphone.audioStreamBasicDescription(), destinationFileType: EZRecorderFileType.M4A)

@ogoldfinger
Copy link

One thing worth noting is that I'm playing an AVAudioPlayer in the background the same time as I'm recording. Think that has anything to do with it?

@ogoldfinger
Copy link

If it gives you an idea, it feels to me like this issue only appears if my CPU is working hard. I'm using EZAudioPlot to show microphone activity and I think every time I've seen this issue the UI seems to be choking a bit.

@swaroopbutala
Copy link
Author

I am using EZAudioPlot too.

On Tuesday, May 5, 2015, ogoldfinger notifications@github.com wrote:

If it gives you an idea, it feels to me like this issue only appears if my
CPU is working hard. I'm using EZAudioPlot to show microphone activity and
I think every time I've seen this issue the UI seems to be choking a bit.


Reply to this email directly or view it on GitHub
#152 (comment).

Swaroop

@ogoldfinger
Copy link

One thing I just tried which looks like it may have fixed this issue is delaying the initialization of the microphone to viewDidAppear from viewDidLoad. Swaroop -- may be worth you trying the same and see if that worked for you.

  • (void) viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];

    if(!self._microphone) {
    self._microphone = [EZMicrophone microphoneWithDelegate:self];
    }
    }

@syedhali
Copy link
Owner

I'm wondering if this was happening because the previous version of the EZAudioPlot before the 0.2.0 was pretty CPU intensive. Could you update your EZAudio version to 0.2.0 or later and try to reproduce this issue?

@syedhali
Copy link
Owner

syedhali commented Jul 3, 2015

I can't seem to reproduce so I'm going to close this for now. Feel free to reopen if you update EZAudio to at least 0.7.1 and still experience the same issues.

@syedhali syedhali closed this as completed Jul 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants