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

How to change sample rate #39

Closed
soulfly opened this issue Dec 19, 2012 · 7 comments
Closed

How to change sample rate #39

soulfly opened this issue Dec 19, 2012 · 7 comments

Comments

@soulfly
Copy link

soulfly commented Dec 19, 2012

Hi, could you explain how to change current sample rate?

Lines
inputFormat.mSampleRate = 44100.0;
outputFormat.mSampleRate = 44100.0;

dont affect to this

thanks

@soulfly
Copy link
Author

soulfly commented Dec 19, 2012

already implemented
https://github.com/soulfly/novocaine/commit/b4ce807c110c4f1b68e355a26a0617c9882c100c
hope this help to other

@partho-maple
Copy link

I am working on an iOS audio processing app where i would like to use novocaine project. But i need to change the default input and output audio settings. The settings is(may be, but i am not sure.)...

inputFormat.mSampleRate = 44100.0;
outputFormat.mSampleRate = 44100.0;
mBitsPerChannel = 32;
mBytesPerSample = 4
mNumberOfChannels = 2

But i need to change the input and output audio settings to the following...

inputAudioStream.mSampleRate = 8000.0;
inputAudioStream.mFormatID = kAudioFormatLinearPCM;
inputAudioStream.mBitsPerChannel = 16;
inputAudioStream.mBytesPerFrame = 2;
inputAudioStream.mChannelsPerFrame = 1;
inputAudioStream.mFramesPerPacket = 1;
inputAudioStream.mReserved = 0;

outputAudioStream.mSampleRate = 8000.0;
outputAudioStream.mFormatID = kAudioFormatLinearPCM;
outputAudioStream.mBitsPerChannel = 16;
outputAudioStream.mBytesPerFrame = 2;
outputAudioStream.mChannelsPerFrame = 1;
outputAudioStream.mFramesPerPacket = 1;
outputAudioStream.mReserved = 0;
Can you please suggest me that from where and how i will be able to do this ? Any sample code would be very help full.

Thanks in advance for your help and time.

@partho-maple
Copy link

@soulfly Would you please answer this question ? I would be very grateful if you do that.
Thanks.

@soulfly
Copy link
Author

soulfly commented Oct 20, 2013

Please check my fork
https://github.com/soulfly/novocaine/commit/b4ce807c110c4f1b68e355a26a0617c9882c100c

I use 8000 sample rate

@partho-maple
Copy link

@soulfly I have checked it and already implemented it successfully. But i couldn't change the settings. Can you please advise me that how can i change the other settings ?

@soulfly
Copy link
Author

soulfly commented Oct 21, 2013

Which other settings do you need to change? Not sure exactly what you mean

@partho-maple
Copy link

@soulfly You have described how to change mSampleRate to 8000Hz of AudioStreamBasicDescription for both input and output.

But i also need to change mFormatID, mBitsPerChannel, mBytesPerFrame, mChannelsPerFrame, mFramesPerPacket, mReserved of AudioStreamBasicDescription for both input and output. Actually i want to change the current settings to the following for both input and output...

mFormatID = kAudioFormatLinearPCM;
mBitsPerChannel = 16;
mBytesPerFrame = 2;
mChannelsPerFrame = 1;
mFramesPerPacket = 1;
mReserved = 0;

I badly need this. Please help me with this. And feel free to ask me any question.

Thank you very much for your help.

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

2 participants