Sampling rate with audio mechanica

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
PeterLeRoi
Posts: 31
Joined: Wed May 16, 2007 11:08 am

Sampling rate with audio mechanica

Post by PeterLeRoi »

Hello. I´m using Audio Mechanica´s source code to program a speech recognition for psp. The problem: Audio Mechanica samples at 44100 Hz, and I need 8000 Hz.

I thought the frequency could be changed in:

pspAudioInputInit(mic_level, 44100);

but if changed to 8000, my psp samples faster instead of slower :'( ... and fulls the buffer so quickly it freezes after 1 sec aprox.

Any ideas where can I change the sampling rate?

Thanks ;)
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

It's really the audio input lib that samples at 44100, same as the output
lib at the time.
It's only after AM came out we were able to change output frequency.

One solution is to handle it yourself the same way AM does it by ignoring
the samples you don't want.
As you can see from the source it is easier when the desired rate is divisible by 44100 though.

The author of the input lib is not active in the PSP community at the moment
due to work commitments.

If your writing your own program entirely (well at least using nothing more than AM)
I don't understand why you would need 8000 rate specificaly.
If not actually, then potentially.
PeterLeRoi
Posts: 31
Joined: Wed May 16, 2007 11:08 am

Post by PeterLeRoi »

I need to include a .c file (one piece of the recognition part) which only works at 8000 Hz :(

8000 Hz is the lower frequency for speech recognition (well, taking the voice´s bandwidth from 0 Hz until 4000 Hz)

Thanks anyway, I´ll find some way to encode from 44,1 KHz to 8 KHz by software :)

Edit :

I´ve been reading docs... psp can sample at 44100 or 48000. At http://psp.jim.sh/pspsdk-doc/ , there´s the doc of a function: sceAudioSetFrequency but it doesn´t say which library it belongs.... :(

With 48000 Hz it would be perfect :)
Post Reply