Recent Posts

Pages: 1 ... 8 9 [10]
91
General Jo Engine Help / Re: A few questions about PCM functionality
« Last post by XL2 on September 23, 2017, 02:51:59 am »
Just a wild guess, but they seem way too big, they wouldn't fit the audio ram and you might also run out of ram memory.
Try playing with the malloc setting to free some ram to fit them.
You could also just send them to the low work ram (I don't know by heart the adress, but it's something like 0x20000), but I'm not sure if it will work.
I don't know if it can be stored in the audio RAM either as I've never tried it, so you can also give it a try if you want.

Try to declare it something like :

#define LOW_WORK_RAM (0x20000)  //I just typed something, don't copy it blindly as I'm not sure it's the right adress)
jo_sound * blop;

void        load_cop_sound(void)
{
            blop = (jo_sound*) (LOW_WORK_RAM);
            jo_audio_load_pcm("B.PCM",JoSoundMono8Bit, blop);
}
92
General Jo Engine Help / Re: A few questions about PCM functionality
« Last post by LackofTrack on September 22, 2017, 04:45:23 pm »
Here's the two audio files I'm using.
93
General Jo Engine Help / Re: A few questions about PCM functionality
« Last post by XL2 on September 22, 2017, 03:43:14 pm »
For me the  jo_audio_play_sound causes crashes when more than 2 sounds are playing (like I get 2 rings in a row in Sonic and jump at the same time).
Is there an overflow check?
I'm using the play on channel function instead, which prevents crashes, but doesn't allow me to play many files at once.

Also, one thing I noticed, the audio files are loaded in the HWRAM.

Can't they simply be loaded in the audio ram to free up some main ram, or the only way to do that would be by using a .c file for the audio instead of a PCM file?
94
General Jo Engine Help / Re: A few questions about PCM functionality
« Last post by mindslight on September 22, 2017, 12:30:44 pm »
Can you attach audio files please ?
95
General Jo Engine Help / Re: A few questions about PCM functionality
« Last post by LackofTrack on September 22, 2017, 09:21:49 am »
Hello,
Thanks, but that was not the issue I having.
The problem happens when I try to load 2 PCM files at the same time that together are over the memory limit of the saturn. I've tried using jo_audio_free_pcm but it doesn't seem to work properly. Is my code is wrong?


Code: [Select]
#include <jo/jo.h>
#include <jo/audio.h>

static jo_sound     blop;
static jo_sound     cop;

void my_draw(void)
{
    jo_printf(0, 0, jo_get_last_error());
    jo_printf(0, 1, "Press A to play PCM sound");
    jo_printf(0, 2, "Press B to play CD music");
    jo_printf(0, 3, "Press C to play PCM2 music");
    jo_printf(0, 4, "Audio channel usage: %d%% ", jo_audio_usage_percent());
}


void my_gamepad(void)
{
    static int  is_cd_playing = 0;

    if (!jo_is_pad1_available())
        return ;
    if (jo_is_pad1_key_pressed(JO_KEY_A))
        jo_audio_play_sound_on_channel(&blop, 0);
    if (jo_is_pad1_key_pressed(JO_KEY_B) && !is_cd_playing)
    {
        /* the first track is reserved for the game binary so the first track is 2 */
        jo_audio_play_cd_track(2, 2, 1);
        is_cd_playing = 1;
    }
      if    (jo_is_pad1_key_pressed(JO_KEY_C))
        jo_audio_play_sound(&cop);

}



void        load_blop_sound(void)
{
            jo_audio_load_pcm("A.PCM",JoSoundMono8Bit,& blop);

}

void        load_cop_sound(void)
{
            jo_audio_free_pcm(& blop);
            jo_audio_load_pcm("B.PCM",JoSoundMono8Bit,& cop);
}


 void jo_main(void)
{
jo_core_init(JO_COLOR_Black);
load_blop_sound();
load_cop_sound();
jo_core_add_callback(my_draw);
jo_core_add_callback(my_gamepad);
jo_core_run();
}

/*
** END OF FILE
*/
96
General Jo Engine Help / Re: A few questions about PCM functionality
« Last post by mindslight on September 22, 2017, 08:34:43 am »
Hi, you can't play multiple sound on the same channel, but you can play 8 sounds on the same time using jo_audio_play_sound which plays the sound on the first available channel.

See documentation here:
http://jo-engine.org/doxygen/audio_8h.html
97
General Jo Engine Help / Re: Booting Jo Engine games with Pseudo Saturn Kai?
« Last post by mindslight on September 22, 2017, 08:29:06 am »
Yep, I will add an option for this
98
General Jo Engine Help / Re: A few questions about PCM functionality
« Last post by LackofTrack on September 22, 2017, 04:22:18 am »
Whew! Good to know I wasn't doing something wrong.  :D

Just to be clear I wasn't trying to play 2 PCM files once. I was trying to make it so that if I presses A "A.PCM" would play then if I pressed B "A.PCM" would be cleared from memory and then "B.PCM" would play but like I said I couldn't get it to work properly.

Also for some reason CD playback only seems to play in mono even if the Wav file itself is stereo. Is this also an issue you have been having?
99
General Jo Engine Help / Re: Booting Jo Engine games with Pseudo Saturn Kai?
« Last post by XL2 on September 22, 2017, 02:32:44 am »
It seems like the problem comes from the extended ram malloc. Deactivate it for the time being in the Jo Engine source files and it will work fine. Another solution is to use pseudo saturn on a cartdridge without ram.
100
General Jo Engine Help / Re: A few questions about PCM functionality
« Last post by XL2 on September 22, 2017, 02:30:52 am »
Nice to know that the different frequencies didn't play nice for you since I now know I'm not alone!
For the audio, there is no overflow check AFAIK, so if you specify a channel to play on you will probably get crashes.
I also can't play more than 2 audio files at the same time, but I know Johannes wants to fully modify the audio implementation, so maybe you can try the SGL functions for the time being.
Pages: 1 ... 8 9 [10]
SMF spam blocked by CleanTalk