viro icon indicating copy to clipboard operation
viro copied to clipboard

ViroSound/Spatial Sound not working

Open Geli25 opened this issue 7 years ago • 10 comments

Environment

Please provide the following information about your environment:

  1. Development OS: Mac
  2. Device OS & Version: iOS 12.0 iPad
  3. Version: ViroReact newest Version and 0.57.1
  4. Device(s): iPad

Description

I have a question regarding ViroSound/SpatialSound. It doesn't seem to play at all. I've put it inside of a ViroNode with two FlexViews. The source link is correct but no sound plays, I've put it in a local folder. Am I doing this correctly?

Thanks.

        <ViroNode>
        <ViroFlexView
            materials="card"
            height={4}
            width={4.5}
            position={[0, 0, -10]}>
            <ViroImage
                height={2}
                width={3.5}
                source={require("./res/recipes.png")}
            />
            <ViroAnimatedImage
                style={{marginLeft:0.2}}
                height={0.9}
                width={1.5}
                source={require("./res/giphyfab.gif")}
            />
        </ViroFlexView>
        <ViroFlexView
            height={3}
            width={3.5}
            position={[-5, 0, -10]}>
            <ViroImage
                opacity={0.95}
                height={3}
                width={3.5}
                source={require("./res/dummy.png")}
            />
        </ViroFlexView>
        **<ViroSpatialSound source={require("./res/jazz.mp3")} />**
        </ViroNode>

Geli25 avatar Jan 17 '19 01:01 Geli25

Not exactly sure what the issue might be. Can you try adding a position or volume to the spatial sound component. There is an example under our Sound section -> https://docs.viromedia.com/v2.13.0/docs/audio

dam00n avatar Jan 17 '19 17:01 dam00n

I have done both, and added volume and mute options for ViroSound as well, none seem to play. For Spatialsound I put it close to me on the z axis as well but no luck. Are you able to replicate the issue?

Geli25 avatar Jan 17 '19 19:01 Geli25

Can you try adding -> paused={false}

dam00n avatar Jan 17 '19 19:01 dam00n

Have done that as well.

Geli25 avatar Jan 17 '19 22:01 Geli25

This might be an issue with the sound file you are trying to use. Spatial sound requires a single-channel sound (mono). Here is a link to a sound file that should work -> https://s3-us-west-2.amazonaws.com/viro/cube_sound.wav

dam00n avatar Jan 17 '19 23:01 dam00n

Hmm, ok i will try that. But ViroSound also wasn't working, does it have the same requirement?

Geli25 avatar Jan 17 '19 23:01 Geli25

ViroSound is working for me. Here is a link to an mp3 file you can try -> https://s3-us-west-2.amazonaws.com/viro/Assets/rain.mp3

dam00n avatar Jan 17 '19 23:01 dam00n

I've tried the sound but it only seems to work in Android and not on iOS, this is for both ViroSound and ViroSpatialSound.

Geli25 avatar Jan 25 '19 13:01 Geli25

Interesting, I tested both ViroSound and ViroSpatialSound on iOS (iPhone X) and they were working fine with the files listed above. Is it possible there is a volume setting on your device you need to adjust? Otherwise, I am not sure what the issue could be.

dam00n avatar Jan 25 '19 17:01 dam00n

I tested it on iOS and it is now working. I had to fill out all the essential props for it to play, perhaps some of the defaults are not registering. On Android though, the sound plays fine without these props so I assume the defaults work there.

Geli25 avatar Mar 01 '19 14:03 Geli25