Pitch control for Recorder
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2267 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
174f4945f3
commit
5ed78ea80c
2 changed files with 23 additions and 0 deletions
|
@ -1787,6 +1787,26 @@ void mpeg_sound_channel_config(int configuration)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_MAS3587F
|
||||||
|
/* This function works by telling the decoder that we have another
|
||||||
|
crystal frequency than we actually have. It will adjust its internal
|
||||||
|
parameters and the result is that the audio is played at another pitch */
|
||||||
|
void mpeg_set_pitch(int percent)
|
||||||
|
{
|
||||||
|
unsigned long val;
|
||||||
|
|
||||||
|
/* Calculate the new (bogus) frequency */
|
||||||
|
val = 18432 + (18432*percent/100);
|
||||||
|
|
||||||
|
mas_writemem(MAS_BANK_D0,0x7f3,&val,1);
|
||||||
|
|
||||||
|
/* We must tell the MAS that the frequency has changed.
|
||||||
|
This will unfortunately cause a short silence. */
|
||||||
|
val = 0x25;
|
||||||
|
mas_writemem(MAS_BANK_D0,0x7f1,&val,1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void mpeg_init(int volume, int bass, int treble, int balance, int loudness, int bass_boost, int avc)
|
void mpeg_init(int volume, int bass, int treble, int balance, int loudness, int bass_boost, int avc)
|
||||||
{
|
{
|
||||||
#ifdef SIMULATOR
|
#ifdef SIMULATOR
|
||||||
|
|
|
@ -41,6 +41,9 @@ char *mpeg_sound_unit(int setting);
|
||||||
int mpeg_sound_numdecimals(int setting);
|
int mpeg_sound_numdecimals(int setting);
|
||||||
struct mp3entry* mpeg_current_track(void);
|
struct mp3entry* mpeg_current_track(void);
|
||||||
bool mpeg_has_changed_track(void);
|
bool mpeg_has_changed_track(void);
|
||||||
|
#ifdef HAVE_MAS3587F
|
||||||
|
void mpeg_set_pitch(int percent);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SOUND_VOLUME 0
|
#define SOUND_VOLUME 0
|
||||||
#define SOUND_BASS 1
|
#define SOUND_BASS 1
|
||||||
|
|
Loading…
Reference in a new issue