Distorted audio effects on iPhone (.m4a file)

GoldWave general discussions and community help
Post Reply
RV55
Posts: 9
Joined: Thu Feb 02, 2017 1:06 pm

Distorted audio effects on iPhone (.m4a file)

Post by RV55 »

Hello!

I really didn't know where else to turn for help. I made an HTMl5 game and use a program called Construct 2 to make it. Now, when I import the original .wav sound effects I bought, the program automatically converts it to .m4a and .ogg. .m4a is apparently used by iPhone and the .ogg by Android.

When testing my game, Android plays the sounds perfectly and at the set up volume. Same for desktop PC. But on iPhone, doesn't matter which I think (I tried iPhone 5SE and iPhone 6) the .m4a sounds sound very distorted and are barely hearable. Switching browsers doesn't seem to make a difference.

Here's a test project I set up: It uses the .m4a and .ogg files. http://mediaconceptfactory.com/test/TestSound/

Don't forget! When testing on iPhone you must touch the white screen else nothing will be played. The specific audio sound that is being distorted will be played every 2 seconds.

The funny thing is, it's not Construct 2's fault. When I export the original .wav file to .m4a with Goldwave the quality is reduced, and on iPhone the same distorted effect takes place. I put the Goldwave created .m4a files in the exported game project folder (after export) to make sure it isn't the Construct 2 program.

It gets even weirder. It's these specific 'Pop' sounds that are distorted. I can play OTHER sound effects from the same sound pack just fine, even after conversion to .m4a!

I contacted the creator of the sound pack and we tried some stuff but unfortunately we've been unable to figure it out.

I really like these Pop sounds and want to use them in my game but I just can't get them to sound right on iPhones!

Thanks for any replies!
DougDbug
Posts: 2172
Joined: Wed Feb 16, 2005 3:33 pm
Location: Silicon Valley

Re: Distorted audio effects on iPhone (.m4a file)

Post by DougDbug »

I don't have an iPhone but I'm going to guess it's a phase/polarity inversion problem where the left & right channels are partially canceled when it's mixed-down to mono (if you are listening to the phone's speaker). As a quick-check, plug-in stereo earphones/headphones to see if it sounds OK in stereo.

...You can invert one channel in Goldwave but that may cause other parts of the sound to be canceled. (Select just one channel for editing, then use the Invert effect.)

And, I don't know why it would be different on Android or in a different format.
The funny thing is, it's not Construct 2's fault. When I export the original .wav file to .m4a with Goldwave the quality is reduced,
Is the sound "damaged" when you play the M4A file on the computer?

...M4A (and OGG and MP3, etc.) are lossy compression and the quality depends on the amount of compression, but I doubt that's the issue.
RV55
Posts: 9
Joined: Thu Feb 02, 2017 1:06 pm

Re: Distorted audio effects on iPhone (.m4a file)

Post by RV55 »

Hello!

Thanks for your reply.

I plugged in the headphones, but same distortion.

OK so I went into Goldwave > edit> select left channel. Then effect > invert. When I play it, I barely hear any difference. That goes for both the .m4a and .wav sound.

OK so I've uploaded the sound effects:

http://mediaconceptfactory.com/test/pop5.wav
http://mediaconceptfactory.com/test/pop5.m4a

You will notice the difference in quality by ear and visually when opened in Goldwave.

The reason it sounds perfectly fine on Android is because it uses the .ogg files. This program 'Construct 2' I use converts the .wav file to both .m4a and .ogg. But like I said it's not that specific program.

The .ogg files have, for some reason, less compression or something.

Anyway yes - the .m4a sounds a bit 'damaged' on my desktop PC. As if it has less quality than the .ogg and .wav.

I also just tested on my older iPhone 5C and it has the same distorted sound as on my iPhone 5SE.

Thanks again.
DougDbug
Posts: 2172
Joined: Wed Feb 16, 2005 3:33 pm
Location: Silicon Valley

Re: Distorted audio effects on iPhone (.m4a file)

Post by DougDbug »

I don't think this explains it, but OGG, M4A, and MP3 are all lossy compression. At a high-enough bitrate (kbps) they should (usually) all sound identical (or nearly identical) to the uncompressed original.

But of course they all use different compression algorithms and at lower bitrates one of the formats may be better than others and if you go low-enough you are throwing-away lots of information and it can sound like a cell phone connection.

Some sounds are more "difficult" to compress than others.... For example, if you convert all of your CDs to MP3 using a high-quality setting, most of the MP3s will sound identical to the CD. But you may hear the quality loss, or a difference, with some songs.

Also, the "damage" accumulates. If you convert an M4A file to MP3, you've gone through an additional generation of lossy compression. Or, if you open an M4A file in GoldWave (or any "normal" audio editor) it gets decompressed. If you re-save as M4A (or other lossy format) you've gone through another generation of lossy compression.


-------------------------------------------------------------------
OK so I went into Goldwave > edit> select left channel. Then effect > invert. When I play it, I barely hear any difference. That goes for both the .m4a and .wav sound
OK, that was just a guess.

Sometimes one channel can be inverted by someone else before you get the file or it can sometimes happen accidently when you record with the "wrong" microphone connections.

If you invert one channel of a "normal song", here's what happens -

If you listen with stereo headphones you won't hear any difference because the left & right never mix and the ear is not very sensitive to phase/polarity.

If you listen with stereo speakers you get a "stereo widening" and maybe a "phasey sound" as the out-of-phase soundwaves mix in the air. Sometimes this is done intentionally for a widening effect. The bass (with longer wavelengths) mixes more consistently and the out-of-phase bass soundwaves mostly cancel each other and you'll hear a loss of bass, so usually the "widening effect" is not intentionally applied to the bass.

If you play-back in mono you get "vocal cancelation" where everything in the center (everything that's identical and in-phase in both channels) is canceled electrically or digitally. The bass, which is almost always perfectly-centered also gets canceled. If both channels are exactly identical everything is canceled and you get silence.

If one channel is inverted and you re-invert it (or if you invert the other channel) everything comes back to normal.
RV55
Posts: 9
Joined: Thu Feb 02, 2017 1:06 pm

Re: Distorted audio effects on iPhone (.m4a file)

Post by RV55 »

Hi,

OK thanks for the explanation.

I'm not sure where to go from here. What would you recommend to the creator of these effects? I have direct email contact with him. I mean if it's possible, to make the sound somehow less likely to lose its content when converted to .m4a. But I don't know what needs to be done in order to maintain the most data as possible. Like somehow make the sound 'thicker' if that's doable.

Or hey, if you're able to and have the time perhaps you could give it a shot? There are in total 5 of these Pop sounds. Or if you could give instructions to do it myself, would be great too.

By the way, the files were delivered as .wav, which is like one of the 'least compressed' file types correct?

In any case, I'm thankful you're thinking along.
DougDbug
Posts: 2172
Joined: Wed Feb 16, 2005 3:33 pm
Location: Silicon Valley

Re: Distorted audio effects on iPhone (.m4a file)

Post by DougDbug »

I can't actually listen to your file 'cause I'm at work right now, but I looked at the waveforms. Usually you can't tell a lot by looking but yes, I can see a difference between the original WAV and the M4A.

Now I think it IS a limitation of the lossy compression but I may have a found a "better" encoder: TAudioConverter.

For the Codec I chose [lossy] [*.M4A] Fraunhofer FDK AAC
Then for Codec Options, Method = CBR and Bitrate = 192.

...Sometimes when starting TAudioConverter I get a "Missing BASS.DLL" error but I just click "OK" and it works. (And, you might get that error more than once on a multi-core computer.)

It looks like M4A adds a few milliseconds of silence to the beginning of the file. MP3 does the same thing, but I was not aware that M4A also does it.
But I don't know what needs to be done in order to maintain the most data as possible...

...By the way, the files were delivered as .wav, which is like one of the 'least compressed' file types correct?
Yes, WAV is lossless. The "amount of data" (resolution) varies depending on the bit depth and sample rate. Your WAV file is 16-bit/44.1kHz which is "CD quality" and better than human hearing.

The bitrate (kbps = kilobits per second) is related to the amount of compression and gives a rough indication of quality. Higher bitrate = less compression = bigger files = better quality. It's not the whole story, but with smaller files you have to throw-away more data and the more you have to compromise.

I actually tried TAudioConverter because I wanted to see if I could use a higher bitrate and 360kbps seemed to help, but the waveform also "looks good" at 192kbps with that encoder.

As you may know there are 8 bits in a byte so you can calculate file size* from the bitrate and playing time.

We don't usually talk about the bitrate for uncompressed files, but the bitrate for CD-quality files is 16 bits X 44,100 samples per second X 2 channels = 1411kbps. With lossy compression you can usually get a high-quality file 1/5th of that bitrate (and 1/5th of the size). These lossy compression algorithms try to throw-away "little details" that you can't hear and they usually do a good job, but it's not simply a matter of throwing-away 80% of the data... There's a lot more going-on... For example, with lossless compression (such as FLAC) you usually get a bitrate that's about 60% of the original. (Obviously, with lossless compression you are not throwing-away any data but you can still get a smaller file.)


* It's not always an exact calculation. There are file headers and music files often contain metadata including album artwork and those things add to file size without affecting the bitrate.
RV55
Posts: 9
Joined: Thu Feb 02, 2017 1:06 pm

Re: Distorted audio effects on iPhone (.m4a file)

Post by RV55 »

Hi,

Thanks for your reply.

Well I downloaded TAC, set it as you recommended, only I get an error 'Files could not be created'.

Doesn't seem to matter if I choose to convert only one file or more, change the output folder, or check 'Same as source'.

Here's the error log:

Code: Select all

[13-4-2019 16:01:22] Started deleting temp files...
[13-4-2019 16:01:22] Temp Folder: C:\Users\Rudolf\AppData\Local\Temp\TAudioConverter\
[13-4-2019 16:01:22] Deleted 0 file(s).
[13-4-2019 16:01:22] Finished deleting temp files.


[13-4-2019 16:01:22] Number of processes is more than/equal to your CPU's core count. Consider lowering it.

[13-4-2019 16:01:22] TAudioConverter package is 64bit.

[13-4-2019 16:01:22] Number of commands per process are as follows:
[13-4-2019 16:01:22] Encoder1: 8
[13-4-2019 16:01:22] Encoder2: 4
[13-4-2019 16:01:22] Encoder3: 4
[13-4-2019 16:01:22] Encoder4: 4
[13-4-2019 16:01:22] Encoder5: 0
[13-4-2019 16:01:22] Encoder6: 0
[13-4-2019 16:01:22] Encoder7: 0
[13-4-2019 16:01:22] Encoder8: 0
[13-4-2019 16:01:22] Encoder9: 0
[13-4-2019 16:01:22] Encoder10: 0
[13-4-2019 16:01:22] Encoder11: 0
[13-4-2019 16:01:22] Encoder12: 0
[13-4-2019 16:01:22] Encoder13: 0
[13-4-2019 16:01:22] Encoder14: 0
[13-4-2019 16:01:22] Encoder15: 0
[13-4-2019 16:01:22] Encoder16: 0

[13-4-2019 16:01:22] Writing commands to logs

[13-4-2019 16:01:22] ----Encoding Summary----
[13-4-2019 16:01:22]         -Number of processes: 4
[13-4-2019 16:01:22]         -Copy tags: True
[13-4-2019 16:01:22]         -Use custom tags: False
[13-4-2019 16:01:22]         -Enable artwork: False
[13-4-2019 16:01:22]         -Overwrite mode: Add index to new files
[13-4-2019 16:01:22]         -Copy artwork to output: True
[13-4-2019 16:01:22]         -Copy external artwork: False
[13-4-2019 16:01:22]         -Add encoder suffix: True
[13-4-2019 16:01:22]         -Same as source: True
[13-4-2019 16:01:22]         -Enable ReplayGain: False
[13-4-2019 16:01:22]     +Audio
[13-4-2019 16:01:22]         -Encoder: FHG AAC
[13-4-2019 16:01:22]         -CBR: 192 kbps
[13-4-2019 16:01:22]         -Profile: Auto
[13-4-2019 16:01:22]         -Bit Depth: Original
[13-4-2019 16:01:22]     +Effects
[13-4-2019 16:01:22]         -Disabled
[13-4-2019 16:01:22] Temp: C:\Users\Rudolf\AppData\Local\Temp\TAudioConverter\
[13-4-2019 16:01:22] Output: Same as source
[13-4-2019 16:01:22] ----Encoding Summary----

[13-4-2019 16:01:23] [ttagger.exe] Exit code: 3
[13-4-2019 16:01:23] [ttagger.exe] Exit code: 3
[13-4-2019 16:01:23] [ttagger.exe] Exit code: 3
[13-4-2019 16:01:23] [ttagger.exe] Exit code: 3
[13-4-2019 16:01:23] [ttagger.exe] Exit code: 3
[13-4-2019 16:01:23] Started deleting temp files...
[13-4-2019 16:01:23] Temp Folder: C:\Users\Rudolf\AppData\Local\Temp\TAudioConverter\
[13-4-2019 16:01:23] Deleted 10 file(s).
[13-4-2019 16:01:23] Finished deleting temp files.

[13-4-2019 16:01:23] Cannot find output file C:\Users\Rudolf\Desktop\Pop2.m4a
[13-4-2019 16:01:23] Cannot find output file C:\Users\Rudolf\Desktop\Pop3.m4a
[13-4-2019 16:01:23] Cannot find output file C:\Users\Rudolf\Desktop\Pop4.m4a
[13-4-2019 16:01:23] Cannot find output file C:\Users\Rudolf\Desktop\Pop5.m4a
[13-4-2019 16:01:23] Cannot find output file C:\Users\Rudolf\Desktop\Pop6.m4a
I think it might have to do with folder permissions? I don't get that missing DLL error though.
Post Reply