Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Probably hardest part of making my game is creating music (because I just can't do it right). So, I thought about using "ccbPlaySound" comand to implement the usage of custom music. Here's the problem though: it cannot be looped normally. I suppose that it would be fine if there would be a way to get the music length, so that, after a specified (by the length of track) period of time it would play it again. So, is there a way to get the length of, for example, MP3 file with available API of Coppercube or a "system" comand? |
||||
|
MP3 files dont work for me.. but with WAV you can do .. Add 3dSound Node to the scene first then name it snd.. In options set it playmode "nothing" set PlayAs2D = true EDITED: ccbSetSceneNodeProperty(ccbGetSceneNodeFromName("snd"), "PlayMode","looping"); ccbSetSceneNodeProperty(ccbGetSceneNodeFromName("snd"), "SoundFileName","IonBronze.wav"); ccbPlaySound(ccbGetSceneNodeFromName("snd")); It was a fast test because i was interested in this question also- may not work as expected and may not be the answer what you were looking for. |
||||
|
I don't know why but I got some weird sound glitches doing it the way Sven did. Might be on my end though. I used an ogg file for this and it works. I just didn't set the name of the sound file in the editor and did it through code instead. https://files.catbox.moe/6mxaoj.... |
||||
|
Okay, I tried to use "3D sound" object, and it actually works. I thought it needs full path name at first, but now... Well, now, I suppose, not only I can implement usage of custom music, I can also separate sound options into general sound volume (system.soundvolume) and a music volume, which is also cool! Thanks, sven. By the way, cool music in your example, Guest. |
|