Flash can't play WAV
Monkey Targets Forums/Flash/Flash can't play WAV
| ||
| Hi all, I can't play a simple wav file in the flash target. Here's my test code:
Strict
Import mojo
Global testApp:Test
Function Main:Int()
testApp = New Test()
Return 0
End Function
Class Test Extends App
Field sfx:Sound
Method OnCreate:Int()
sfx = LoadSound( "swoosh.wav" )
SetUpdateRate(30)
Return 0
End Method
Method OnUpdate:Int()
Return 0
End Method
Method OnSuspend:Int()
Return 0
End Method
Method OnResume:Int()
Return 0
End Method
Method OnRender:Int()
Cls()
DrawText( "Press left mouse button to play a sound!", 10, 10 )
If( TouchDown( 0 ) ) Then PlaySound( sfx )
Return 0
End Method
End Class
Link to the wav: http://www.xaron.net/dl/monkey/swoosh.wav Complete project: http://www.xaron.net/dl/monkey/flashtest.zip |
| ||
| Ok... looks like it's my fault. V51 Flash can only play MP3, right? But I can add it to V52 via the config.txt... edit: NO BUG. Sorry for that. Flash can only do MP3. Ok, need to read the documentation better. ;) |
| ||
| Moved to Flash forum as it may still help others! |
| ||
| Yes, this is not a problem with Monkey but with Flash itself. Flash can only play mp3 out of the box. If you want it to support other formats (.ogg, or other chiptunes format) you have to find 3rd party code or library that add this functionality. |
| ||
| I'm trying to play .mp3 files and its not making a sound. |