• Editor
  • Sound/Music in Animate Mode?

Hello, I'm still pretty new to Spine. I'm using it at my current job to animate assets for slot games and have been listening along to many of Erika's and Armananimation's youtube videos.

However, I can't seem to figure out how to get audio files to play in my animations?
I'm trying to animate a host character idle sequence to the base game music. Nothing complicated, I'd just like to incorporate some of his motions or gestures to points in the song. Further along in my project I would eventually like to have some lip-sync moments for when a prize is awarded.

I've made it as far as attaching a .wav file to an event and keying it. But past this I can't find anything online to help me get the audio to play. Is there a particular value the integer/float have to be set to? What am I overlooking?

I'm using Spine version 4.2.36 on both a Windows PC and an Intel Mac

Forgive me if this is a common question!

Related Discussions
...

Setting an audio path and keying an event is sufficient for it to play in animate mode. Can you post or email your project, including an audio file? contact@esotericsoftware.com

    Nate Unfortunately can't share the file as it's a game under development. Are there any guidelines for audio files I have to follow to play? Or a specific folder or spot/naming in the project where it must reside? Right now it's a 33mb .wav with stereo sound that plays for about 2 minutes at a bit rate of 2116kbs. I have the track set to an event that's keyed on the very first frame of my animation.
    It's in a folder labeled "audio" inside my project folder and the file is simply called "BaseGameMusic". The sound wave icon is displaying as green in the tree as well.

    I also tried turning off the physics constraints on my character, as I learned here in a previous post, but that didn't make a difference either.

    When I hit play, it does show the name of the event on screen slowly floating up. So I know it's being activated.

    I tried starting a new fresh file using the same audio, but had the same results with no sound.

      ErikS_in2D

      Are there any guidelines for audio files I have to follow to play?

      The requirements for audio files that can be played in Spine are not that tricky, so there is nothing to add except that Spine can play files with .wav, .mp3, or .ogg extensions.

      Or a specific folder or spot/naming in the project where it must reside?

      If you see the audio file in the Audio node of the tree view as shown below, Spine has correctly searched for that audio file and should be able to play it:

      Since you mentioned that you can see the sound wave icon in the tree, I believe that Spine is able to find the audio file.

      For more clarity, you may want to check the Audio view. The waveform is displayed here:

      Also check the settings in the Volume and Audio device section in the Audio view. If it is muted here or the correct audio device is not selected, you may not hear the sound being played.

      If, after confirming that they are correct, you still cannot hear any of the audio files, please show us a video or screenshot of you trying to play an audio file by creating a new project, etc. instead of your actual project.

        Misaki Thank you for your help! I finally got things sorted out. Using the Audio view, I noticed my wave file had no wave in the view. The file was green in the tree. So I obtained another file of the music from the musician that was about a third the size (from 33mb to 11mb) and the file booted correctly and played!

        I'm not sure what was wrong with the original audio file, but when I opened the Spine file up to work this morning I got a pop-up warning for the audio. One of the lines(45) said "WARNING: Slow file system access: C:/Users/erik.s..." in regards to the audio.

        Then at line 157: ERROR: Audio file could not be decoded: C:/Users/erik.s/Documents/Documents/SlotCompany/GameSeries/FoodPuppets/GameName/./Music/Spicy_BG_V2.wav
        [error] Error reading WAV file: C:/Users/erik.s/Documents/Documents/SlotCompany/GameSeries/FoodPuppets/GameName/./Music/Spicy_BG_V2.wav
        at s.MAP.<init>(:120)
        at s.hlE.B(
        :88)
        at s.hlE.(:37)
        at com.esotericsoftware.spine.editor.audio.Audio.B(:300)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
        Cause: s.Kxg: WAV files must be 8 or 16-bit PCM: 24
        at s.MAP.<init>(
        :112) ...
        ERROR: Audio disabled, unable to initiate OpenAL playback.

        And the last error at line183:
        ERROR: Audio file could not be decoded: C:/Users/erik.s/Documents/Documents/SlotCompany/GameSeries/FoodPuppets/GameName/./Music/Spicy_BG_V2.wav
        [error] Error reading WAV file: C:/Users/erik.s/Documents/Documents/SlotCompany/GameSeries/FoodPuppets/GameName/./Music/Spicy_BG_V2.wav
        at s.MAP.<init>(:120)
        at s.hlE.B(
        :88)
        at s.hlE.(:37)
        at com.esotericsoftware.spine.editor.audio.Audio.B(:300)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
        Cause: s.Kxg: WAV files must be 8 or 16-bit PCM: 24
        at s.MAP.<init>(
        :112) ...
        ERROR: Audio disabled, unable to initiate OpenAL playback.

        One more question in regards to the audio. Now that I have got the audio playing, I have it set up and the event keyed for the Idle animation, but I notice it's also playing in my 20 other animations? I haven't keyed the event to play in the other timelines, so I'm confused at to why it is doing this?

          ErikS_in2D Is this in the editor only or at runtime? If it's in the editor, could it be that you set an Audio event key in the other animations? (A quick way to check is to filter the dopesheet on events and press the spacebar twice to have a full view of the events in it)

            Erika I just checked and I only set up the audio to play on a trial timeline, then deleted the keys for the music event in that timeline. But it's still playing, and playing the music in all the timelines now? I'm using the editor, our company is only using Spine at this moment for png sequence animations. But I am using the audio inside Spine to time the characters motions and lip syncing.

              ErikS_in2D Does this also happen when you restart Spine? And what does your log say after doing it?

                Erika Aha! Closing and re-opening Spine seems to have sorted out this issue, thank you Erika!

                In your error log it shows the reason your file didn't play:

                WAV files must be 8 or 16-bit PCM: 24