Sega Saturn - Problem to play song from the CD

Discussion in 'Sega Saturn Programming and Development' started by LuizNai, Jul 17, 2016.

  1. LuizNai

    LuizNai Robust Member

    Joined:
    Jul 13, 2016
    Messages:
    236
    Likes Received:
    342
    Hi guys, I'm learning how to code for Saturn... I'm using Jo engine(http://www.jo-engine.org/) everything looks fine... I'm really having progress with my test, however I tried to use the audio library and I can't run the musics from the CD.

    This is my test:



    This is my function to call the audio from the CD:

    ///Function for music
    void play_music(void)
    {
    jo_audio_init();
    jo_audio_play_cd_track(2, 2, 1);
    }

    And this is the Wave inside the CD folder:

    [​IMG]

    I've already tried to get in touch with the guy, but I had no answer... any help with this I would appreciate.
     
    Last edited: Jul 25, 2016
  2. LuizNai

    LuizNai Robust Member

    Joined:
    Jul 13, 2016
    Messages:
    236
    Likes Received:
    342
    I also read all the documentation and my code looks fine... I just need to fix it to get all the functions working!!! hehe tks guys!
     
  3. Wraith

    Wraith Member

    Joined:
    Nov 28, 2012
    Messages:
    14
    Likes Received:
    4
    Not sure if this is the issue but from what I can make out between your "Part 2 Video" and picture the audio track is located in the wrong folder. In your "Part 1 Video" the audio track is in the correct folder. Try placing "track1.wav" in the same folder as your Iso/Cue then mount the Cue in a virtual drive and run it in SSF or rip it to Bin/Cue for use with Yabause.

    Also make sure the audio is included on the .cue file ...

    FILE "sl_coff.iso" BINARY
    TRACK 01 MODE1/2048
    INDEX 01 00:00:00
    POSTGAP 00:02:00
    FILE "track1.wav" WAVE
    TRACK 02 AUDIO
    PREGAP 00:02:00
    INDEX 01 00:00:00
     
    Last edited: Jul 18, 2016
    LuizNai likes this.
  4. LuizNai

    LuizNai Robust Member

    Joined:
    Jul 13, 2016
    Messages:
    236
    Likes Received:
    342
    Tks for your help bro, I tried what you said but still the same, the weird thing is that I tried with a PCM audio and it worked... I'll do more tests and I post the solution here when I find it.
     
  5. Wraith

    Wraith Member

    Joined:
    Nov 28, 2012
    Messages:
    14
    Likes Received:
    4
    Stripped down the Audio Demo to force auto play, should work for the moment...

    #include <jo/jo.h>

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

    if (!is_cd_playing)
    {
    jo_audio_play_cd_track(2, 2, 1);
    is_cd_playing = 1;
    }
    }


    void jo_main(void)
    {
    jo_core_init(JO_COLOR_DarkGray);
    jo_core_add_callback(play_music);
    jo_core_run();
    }
     
    LuizNai likes this.
  6. LuizNai

    LuizNai Robust Member

    Joined:
    Jul 13, 2016
    Messages:
    236
    Likes Received:
    342
    I've just found the solution, the problem was not in the code... I took my ISO and my WAV file and I used Sega Cue Maker to prepare the Cue file... then I emulated it in a virtual drive, and it worked! Now I can keep working in my game... thank you man for your help!
     
    Wraith likes this.
  7. Wraith

    Wraith Member

    Joined:
    Nov 28, 2012
    Messages:
    14
    Likes Received:
    4
    Yes, tested the code, works fine. Sometimes it's the little things that get ya.

    Good luck with your project! :D
     
    LuizNai likes this.
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page