Problem with playing mods using BASS

Started by zajkos,

zajkos

I made a small mp3/ogg player and it works perfectly when it's playing mo3 or ogg. But when I implemented mod plyaing feature, it works but the quality of muisc is far from perfect. It sounds like it was in much lower frequency than it should be. I tried probably all the combination of parameters but it did't help.

PS. BASS is a great production and I was amazed by its possibilities!!!

Irrational86

The frequency MOD files are played at is the one you set in the BASS_Init function


Irrational86

hmm...am not really into MOD music, maybe you should wait for a response from someone who knows more about this..specially Ian

Ian @ un4seen

When you say "the quality of muisc is far from perfect", what are you using as reference? Are you sure it's not just the files you're playing - there are some dodgy sounding MODs about :D

zajkos

#5
Yes. I tried it out with Winamp and it sounded much better. I've tried more than 1 mod and all sounded badly. I think the mods were OK because it were mods from AMIGA games.

The fragment of the code looks like this (c++ builder):

Bass_Init(-1,WAVE_FORMAT_4S16,0,Form1->Handle);
Bass_Start();
HMUSIC mod=Bass_MusicLoad(0,Name.c_str),0,0, BASS_MUSIC_RAMPS|BASS_MUSIC_FT2MOD|BASS_MUSIC_FLOAT);
bool playing=Bass_MusicPlay(mod);

Irrational86

#6
QuoteYes. I tried it out with Winamp and it sounded much better. I've tried more than 1 mod and all sounded badly. I think the mods were OK because it were mods from AMIGA games.

The fragment of the code looks like this (c++ builder):

Bass_Init(-1,WAVE_FORMAT_4S16,0,Form1->Handle);
Bass_Start();
HMUSIC mod=Bass_MusicLoad(0,Name.c_str),0,0, BASS_MUSIC_RAMPS|BASS_MUSIC_FT2MOD|BASS_MUSIC_FLOAT);
bool playing=Bass_MusicPlay(mod);
There is your problem, I told you to put the frequency...so change it to this,
Bass_Init(-1,44100,0,Form1->Handle);

zajkos

but WAVE_FORMAT_4S16 means 44100
also the same Bass_Init parameters are used for mp3 playback and they work fine

Irrational86

You have to put the actual frequency, not a flag, i.e. 44100, 48000..etc...Of course it works fine for MP3s...Stream files do not use this frequency, they use the one they are encoded at. Music files (MODs, MO3, XM, IT...etc) are the only ones that use this frequency. If you put the flag WAVE_FORMAT_4S16, you are making the frequency the value of that flag, which is a very small number.

zajkos

YOU ARE RIGHT
That's the point.

BTW. what frequency should I use?

Irrational86

You should use whichever you want. Almost everyone uses 44100, which is like the standard frequency for almost everything. But you could try others, 48000, 96000..etc, its all up to you.