Discuss Scratch
- ResExsention
-
New Scratcher
1000+ posts
Use Opus audio compression
@ResExsention I have uploaded two files: one is an uncompressed recording made directly from a Sega Genesis emulator. The other is that recording encoded with AAC at 128 Kbps and turned back into a WAV file. I challenge you to tell me which one is the compressed one, and you must do it exclusively by ear. You may not use any audio editing tools.
File 1: https://cdn.discordapp.com/attachments/485256412784623626/589860473441353728/Awdio.wav
File 2: https://cdn.discordapp.com/attachments/485256412784623626/589861400453840906/Awdio2.wav
Why did you make me download something? I kind of wasn't expecting it, so I was a bit surprised.
Huh
Awdio2 is compressed. Why? There seems to be a kind of “audio quality loss” after each note, so it just sounds a lot worse.
Still, even though the changes are subtle, they are still there. I need this to be optional, otherwise no support.
- Flowermanvista
-
Scratcher
1000+ posts
Use Opus audio compression
@ResExsention I have uploaded two files: one is an uncompressed recording made directly from a Sega Genesis emulator. The other is that recording encoded with AAC at 128 Kbps and turned back into a WAV file. I challenge you to tell me which one is the compressed one, and you must do it exclusively by ear. You may not use any audio editing tools.
File 1: https://cdn.discordapp.com/attachments/485256412784623626/589860473441353728/Awdio.wav
File 2: https://cdn.discordapp.com/attachments/485256412784623626/589861400453840906/Awdio2.wav
Why did you make me download something? I kind of wasn't expecting it, so I was a bit surprised.
Huh
Awdio2 is compressed. Why? There seems to be a kind of “audio quality loss” after each note, so it just sounds a lot worse.
Still, even though the changes are subtle, they are still there. I need this to be optional, otherwise no support.
I am impressed, but keep in mind: you yourself said that the changes are subtle. Most people probably wouldn't notice it. Also, read the OP again - particularly the part where I said that this could be disabled on a per project basis.
- imfh
-
Scratcher
1000+ posts
Use Opus audio compression
I believe that AAC is supported already supported by Scratch with mp4, so why does it need to automatically compress all sound with it? If someone reaches the limit size limit they can compress it themself into an mp4 format.
- Flowermanvista
-
Scratcher
1000+ posts
Use Opus audio compression
I believe that AAC is supported already supported by Scratch with mp4, so why does it need to automatically compress all sound with it? If someone reaches the limit size limit they can compress it themself into an mp4 format.How many people do you think would be able to do that and still have it sound good?
Also, I tried uploading an AAC stream inside an MP4 file into Scratch. It just sat there endlessly.
- imfh
-
Scratcher
1000+ posts
Use Opus audio compression
However the Scratch Team would make the compression work would have to be in the web browser to prevent massive server load. I imagine that means there is a good possibility that the conversion wouldn't be great either way, not to mention a hassle to create at all.I believe that AAC is supported already supported by Scratch with mp4, so why does it need to automatically compress all sound with it? If someone reaches the limit size limit they can compress it themself into an mp4 format.How many people do you think would be able to do that and still have it sound good?
Also, I tried uploading an AAC stream inside an MP4 file into Scratch. It just sat there endlessly.
The sound not saving is probably not related to it being an AAC MP4 file.
- Flowermanvista
-
Scratcher
1000+ posts
Use Opus audio compression
However the Scratch Team would make the compression work would have to be in the web browser to prevent massive server load. I imagine that means there is a good possibility that the conversion wouldn't be great either way, not to mention a hassle to create at all.I believe that AAC is supported already supported by Scratch with mp4, so why does it need to automatically compress all sound with it? If someone reaches the limit size limit they can compress it themself into an mp4 format.How many people do you think would be able to do that and still have it sound good?
Also, I tried uploading an AAC stream inside an MP4 file into Scratch. It just sat there endlessly.
The sound not saving is probably not related to it being an AAC MP4 file.
I tested it, and encoding 40 seconds of audio to 128 kbps AAC used approximately 60% of my CPU for about 2 seconds - and this is a CPU from 2006 - specifically, the AMD Athlon 64 X2 5200+ . Encoding to AAC is not a CPU-heavy task, and doing it on the server side may be doable. Even if it isn't, almost all computers that are in use today and connected to the Internet should be able to handle encoding to AAC, and I imagine the code that would need to be transmitted to the client to do so would be about 500 KB at the absolute maximum.
- imfh
-
Scratcher
1000+ posts
Use Opus audio compression
It might be doable on the server then. It's hard to say though since I'm not on the Scratch Team. For the client's computer it's less about the size of code to encode AAC and more about creating/finding an encoder that can work in the web browser.However the Scratch Team would make the compression work would have to be in the web browser to prevent massive server load. I imagine that means there is a good possibility that the conversion wouldn't be great either way, not to mention a hassle to create at all.I believe that AAC is supported already supported by Scratch with mp4, so why does it need to automatically compress all sound with it? If someone reaches the limit size limit they can compress it themself into an mp4 format.How many people do you think would be able to do that and still have it sound good?
Also, I tried uploading an AAC stream inside an MP4 file into Scratch. It just sat there endlessly.
The sound not saving is probably not related to it being an AAC MP4 file.
I tested it, and encoding 40 seconds of audio to 128 kbps AAC used approximately 60% of my CPU for about 2 seconds - and this is a CPU from 2006 - specifically, the AMD Athlon 64 X2 5200+ . Encoding to AAC is not a CPU-heavy task, and doing it on the server side may be doable. Even if it isn't, almost all computers that are in use today and connected to the Internet should be able to handle encoding to AAC, and I imagine the code that would need to be transmitted to the client to do so would be about 500 KB at the absolute maximum.
- -Rex-
-
Scratcher
500+ posts
Use Opus audio compression
Any encoding would likely happen on the client side, since Scratch 2.0 already converted MP3 to WAV on the client's computer (and it took a while, although Audacity can do it much faster). Scratch 3.0 doesn't do this because it doesn't convert MP3 files to WAV.It might be doable on the server then. It's hard to say though since I'm not on the Scratch Team. For the client's computer it's less about the size of code to encode AAC and more about creating/finding an encoder that can work in the web browser.However the Scratch Team would make the compression work would have to be in the web browser to prevent massive server load. I imagine that means there is a good possibility that the conversion wouldn't be great either way, not to mention a hassle to create at all.I believe that AAC is supported already supported by Scratch with mp4, so why does it need to automatically compress all sound with it? If someone reaches the limit size limit they can compress it themself into an mp4 format.How many people do you think would be able to do that and still have it sound good?
Also, I tried uploading an AAC stream inside an MP4 file into Scratch. It just sat there endlessly.
The sound not saving is probably not related to it being an AAC MP4 file.
I tested it, and encoding 40 seconds of audio to 128 kbps AAC used approximately 60% of my CPU for about 2 seconds - and this is a CPU from 2006 - specifically, the AMD Athlon 64 X2 5200+ . Encoding to AAC is not a CPU-heavy task, and doing it on the server side may be doable. Even if it isn't, almost all computers that are in use today and connected to the Internet should be able to handle encoding to AAC, and I imagine the code that would need to be transmitted to the client to do so would be about 500 KB at the absolute maximum.
- Flowermanvista
-
Scratcher
1000+ posts
Use Opus audio compression
https://en.wikipedia.org/wiki/EmscriptenIt might be doable on the server then. It's hard to say though since I'm not on the Scratch Team. For the client's computer it's less about the size of code to encode AAC and more about creating/finding an encoder that can work in the web browser.However the Scratch Team would make the compression work would have to be in the web browser to prevent massive server load. I imagine that means there is a good possibility that the conversion wouldn't be great either way, not to mention a hassle to create at all.I believe that AAC is supported already supported by Scratch with mp4, so why does it need to automatically compress all sound with it? If someone reaches the limit size limit they can compress it themself into an mp4 format.How many people do you think would be able to do that and still have it sound good?
Also, I tried uploading an AAC stream inside an MP4 file into Scratch. It just sat there endlessly.
The sound not saving is probably not related to it being an AAC MP4 file.
I tested it, and encoding 40 seconds of audio to 128 kbps AAC used approximately 60% of my CPU for about 2 seconds - and this is a CPU from 2006 - specifically, the AMD Athlon 64 X2 5200+ . Encoding to AAC is not a CPU-heavy task, and doing it on the server side may be doable. Even if it isn't, almost all computers that are in use today and connected to the Internet should be able to handle encoding to AAC, and I imagine the code that would need to be transmitted to the client to do so would be about 500 KB at the absolute maximum.
- ResExsention
-
New Scratcher
1000+ posts
Use Opus audio compression
this could be disabled on a per project basis.
No. I need to be on a sound by sound basis.
It might be doable on the server then. It's hard to say though since I'm not on the Scratch Team. For the client's computer it's less about the size of code to encode AAC and more about creating/finding an encoder that can work in the web browser.However the Scratch Team would make the compression work would have to be in the web browser to prevent massive server load. I imagine that means there is a good possibility that the conversion wouldn't be great either way, not to mention a hassle to create at all.I believe that AAC is supported already supported by Scratch with mp4, so why does it need to automatically compress all sound with it? If someone reaches the limit size limit they can compress it themself into an mp4 format.How many people do you think would be able to do that and still have it sound good?
Also, I tried uploading an AAC stream inside an MP4 file into Scratch. It just sat there endlessly.
The sound not saving is probably not related to it being an AAC MP4 file.
I tested it, and encoding 40 seconds of audio to 128 kbps AAC used approximately 60% of my CPU for about 2 seconds - and this is a CPU from 2006 - specifically, the AMD Athlon 64 X2 5200+ . Encoding to AAC is not a CPU-heavy task, and doing it on the server side may be doable. Even if it isn't, almost all computers that are in use today and connected to the Internet should be able to handle encoding to AAC, and I imagine the code that would need to be transmitted to the client to do so would be about 500 KB at the absolute maximum.
Remember, AAC is closed source.
- Flowermanvista
-
Scratcher
1000+ posts
Use Opus audio compression
this could be disabled on a per project basis.
No. I need to be on a sound by sound basis.
Since you clearly don't like audio compression in your Scratch projects, what's the issue with making it so that all or none of the sounds are compressed on upload?
Also, you're sounding rather demanding at this point, and I'm very wary of entertaining your modifications to my suggestion.
Remember, AAC is closed source.
Closed source codec =/= costs money to use. H.264, a very common proprietary video codec, can be encoded with a piece of free software called x264 that provides excellent video quality, and decoding can be done with free software.
But alas, if a free encoder or one that doesn't cost very much fails to deliver satisfactory results, a free compression method, like Opus or Vorbis, can be used instead. I even wrote this in the OP, so you should have seen it.
- ResExsention
-
New Scratcher
1000+ posts
Use Opus audio compression
this could be disabled on a per project basis.
No. I need to be on a sound by sound basis.
Since you clearly don't like audio compression in your Scratch projects, what's the issue with making it so that all or none of the sounds are compressed on upload?
Also, you're sounding rather demanding at this point, and I'm very wary of entertaining your modifications to my suggestion.Remember, AAC is closed source.
Closed source codec =/= costs money to use. H.264, a very common proprietary video codec, can be encoded with a piece of free software called x264 that provides excellent video quality, and decoding can be done with free software.
But alas, if a free encoder or one that doesn't cost very much fails to deliver satisfactory results, a free compression method, like Opus or Vorbis, can be used instead. I even wrote this in the OP, so you should have seen it.
Yes, sorry about that. I don't know why I'm like that today.
The reason is this. You might want high quality for one sound (say, the SFX) and want lesser quality for something else (like the music). If it's project by project, how would you do that?
No support at the moment.
————————–
I know. I just wanted to point out that the discussion seems to have shifted to AAC…
- Flowermanvista
-
Scratcher
1000+ posts
Use Opus audio compression
The reason is this. You might want high quality for one sound (say, the SFX) and want lesser quality for something else (like the music). If it's project by project, how would you do that?
I'm sure that it wouldn't be too much trouble to add a “compress” option to the right-click dropdown on a sound, and the user would then just set the project to not compress any sounds by default, and then just use that dropdown to compress the sounds they wanted.
- BlueStarPort
-
Scratcher
100+ posts
Use Opus audio compression
Support- This would only make a minor difference in sound quality. The main difference would be that the server would cost the ST less money.
- badatprogrammingibe
-
Scratcher
500+ posts
Use Opus audio compression
No support. Some projects such as this one rely on the fact that the sine waves that are stored are exact, and likely would fail to work if it was compressed.
Scratchers that want to use compressed audio can upload compressed audio, it should not be forced. 99% of audio that's uploaded to the scratch servers is most likely already compressed, so this would have little of an impact.
Scratchers that want to use compressed audio can upload compressed audio, it should not be forced. 99% of audio that's uploaded to the scratch servers is most likely already compressed, so this would have little of an impact.
- Flowermanvista
-
Scratcher
1000+ posts
Use Opus audio compression
The OP said that there would be a way to disable this on a per project basis.
- BlueStarPort
-
Scratcher
100+ posts
Use Opus audio compression
The OP said that there would be a way to disable this on a per project basis.Why did you say “The OP said” if you’re the OP?





