Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411283 Posts in 69325 Topics- by 58380 Members - Latest Member: bob1029

March 29, 2024, 03:15:15 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)OpenFL Sound Help
Pages: [1]
Print
Author Topic: OpenFL Sound Help  (Read 1088 times)
Photon
Level 4
****


View Profile
« on: December 04, 2014, 08:46:35 PM »

I've been practicing some with Haxe and OpenFL for the upcoming Ludum Dare, but that's tomorrow and I have a small issue I haven't figured out yet.

I have a sound (yes, it's spelled correctly) in my assets folder and code much like so:

Code:
var s:Sound = Assets.getSound("sound.mp3");
s.play();

Yet I get an "invalid sound" error. Wouldn't surprise me if its something simple but I have done some searching and Ludum Dare is less than a day away now so I want to get it squared away. Thanks.
Logged
oahda
Level 10
*****



View Profile
« Reply #1 on: December 05, 2014, 03:07:01 AM »

It's spelled correctly, but have you tried different files and other formats than mp3? Are you sure it supports mp3?
Logged

pgil
Level 0
**


View Profile
« Reply #2 on: December 05, 2014, 03:56:49 AM »

What bit rate is it?  I don't know if Haxe/OpelFL is the same, but Flash doesn't support all bitrates with mp3s.  Try encoding it in 128 kbps (constant bitrate), 44100 hz, mono.

Here is a list of all the mp3 formats Flash supports.
Logged
nox
Level 0
***



View Profile WWW
« Reply #3 on: December 05, 2014, 05:22:44 AM »

Change the path to "assets/sound.mp3"
Logged

Photon
Level 4
****


View Profile
« Reply #4 on: December 06, 2014, 08:14:10 AM »

What bit rate is it?  I don't know if Haxe/OpelFL is the same, but Flash doesn't support all bitrates with mp3s.  Try encoding it in 128 kbps (constant bitrate), 44100 hz, mono.

Here is a list of all the mp3 formats Flash supports.
I think this is what it was. I tried something in Audacity, exported and it worked fine (I was using a music file from my library earlier.) Thanks for your input, everyone.
Logged
orionblack
Level 0
**



View Profile WWW
« Reply #5 on: December 10, 2014, 04:53:09 PM »

Sometimes there are issues with id3 tags, keep that in mind if you have similar troubles again.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic