Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Flawake
Copy link
Contributor

@Flawake Flawake commented Dec 26, 2025

W.I.P

@kjarosh
Copy link
Member

kjarosh commented Dec 26, 2025

While testing I found that get_bytes_total actually is 64 bit instead of 32. But I was unable to fix that.

How did you find that? Have you tried playing a 5 GB sound?

@kjarosh kjarosh added A-avm1 Area: AVM1 (ActionScript 1 & 2) T-compat Type: Compatibility with Flash Player labels Dec 26, 2025
@Flawake
Copy link
Contributor Author

Flawake commented Dec 26, 2025

While testing I found that get_bytes_total actually is 64 bit instead of 32. But I was unable to fix that.

How did you find that? Have you tried playing a 5 GB sound?

Yes, that's exactly how I did it.
I created a 5gb mp3 using this ffmpeg command:

ffmpeg -f lavfi -i anoisesrc=color=white:sample_rate=44100 -t 134218 -c:a libmp3lame -b:a 320k noise.mp3

@kjarosh
Copy link
Member

kjarosh commented Dec 26, 2025

You can add a TODO for the u64 total bytes stuff.

@Flawake Flawake force-pushed the sound_bytes branch 2 times, most recently from 9676b3e to 721dc10 Compare December 26, 2025 15:59
@Flawake
Copy link
Contributor Author

Flawake commented Dec 26, 2025

I was sleeping I think. My u64 should have been a u32 instead of the other way around. Has been changed in the last commit

) -> Result<Value<'gc>, Error<'gc>> {
avm1_stub!(activation, "Sound", "getBytesLoaded");
Ok(1.into())
if activation.swf_version() >= 6 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is VERSION_6 so this if does nothing?

) -> Result<Value<'gc>, Error<'gc>> {
avm1_stub!(activation, "Sound", "getBytesTotal");
Ok(1.into())
if activation.swf_version() >= 6 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is VERSION_6 so this if does nothing?

Comment on lines 468 to 470
if let NativeObject::Sound(sound) = this.native() {
if let Some(sound_handle) = sound.sound() {
if let Some(length) = activation.context.audio.get_sound_size(sound_handle) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you invert those ifs you can reduce indentation

@kjarosh
Copy link
Member

kjarosh commented Dec 26, 2025

I was sleeping I think. My u64 should have been a u32 instead of the other way around. Has been changed in the last commit

So it shouldn't be 64-bit?

return Ok(length.into());
}
}
return Ok(1.into());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it return 1 here?

@Flawake Flawake marked this pull request as draft December 26, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-avm1 Area: AVM1 (ActionScript 1 & 2) T-compat Type: Compatibility with Flash Player

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants