Pages

Showing posts with label Gapless Playback. Show all posts
Showing posts with label Gapless Playback. Show all posts

Saturday, January 15, 2011

How To Buy An MP3 Player

"What MP3 player should I buy?"
Every week I see someone on a forum posting a variation on the "what MP3 player should I buy?" question. Which in itself is a variation on the "what TV/car/pet-monkey" question we all get asked from time to time. And in many cases, the person asking the question fails to elaborate on their requirements.
"So really, what MP3 player should I buy?"
Buy an iPod touch. They play music (very well as it happens). They sound good (if you use decent headphones and avoid low bitrates). You can use them to surf and tweet and play Angry Birds. They're easy to use. They look cool. And if you need massive capacity or music only, look at the classic/nano iPods. Are we done?
"But I don't want to be a clone / hate iTunes / need a removable battery / have to play some obscure format / want to be able to drag-and-drop directly onto the player"
Ok, now you're getting somewhere. Questions you should be asking:
  • What are you going to use it for? Music? Videos? Internet? Apps?
  • Do you need a dedicated music-playing gadget, or do you want music to be one of the things your smartphone does?
  • What capacity? How big is your collection? How big will it be in two years' time? How much space do you want to leave for stuff that isn't music?
  • Do you need gapless playback? If you listen to albums or remember ancient technologies like CD, then yes, this is something you want to consider. Very few players support gapless, so this might be something you'll have to compromise on. If all you'll ever do is shuffle or use your own playlists, you can probably live with the player inserting extra gaps between songs.
  • What formats will you be playing? Do you have music/videos in obscure formats? Can you convert your files to something your player can handle (if your music is in lossless then yes, conversion is easy, otherwise this is an issue)? Can you be bothered converting to the best format for your player?
  • Do you need to be able to manage it with direct folder access or otherwise have an irrational phobia of iTunes (or a perfectly rational fear of Sonic Stage)? Do you need to be able to manage it from multiple PCs? If your library is bigger than your player's capacity, managing what's on the player by direct file-copying only could be a challenge.
  • What's your definition of "sound quality"? And will you be bringing the bitrate and headphones to get the best out of it?
  • What about battery life? Will the normal battery-saving tricks of dimming the screen and turning off wi-fi be enough, or do you need to be able to swap-out the battery?
  • How much do you want to spend?

Ok, now you can ask questions, determine the necessities and nice-to-haves, draw up a shortlist, and figure out what player works for you. Incidentally, for me, gapless playback was the dealbreaker that saw me buy players from Rio, Sony and Apple. And remember to budget for some decent headphones and a case, because these days you probably won't get much in the box (actually, I once got decent Sennheiser headphones and a dock bundled as standard with a player, but it was a Rio. And 2004).
"Not buying an iPod. The end."
OK, many people don't want an iPod, for understandable and not-so-understandable reasons. I've seen people claim that they won't entertain the prospect of an iPod touch because it's "an iPhone without the phone" rather than "a music player with touch screen, video, wi-fi, etc". Whatever, if "must not be player X regardless of how suitable it may be" is your number one requirement, at least you're narrowing your shortlist.

I'm not actually answering the question here. I'm not the one buying a new toy. But do think of your requirements before asking a very general question. Or just play safe and buy an iPod.

Friday, December 24, 2010

Digital Music: Gapless Playback

I use the term "gapless playback" a lot. These days it's kind of essential when talking about music playback. "Advances" in digital music playback have spawned the need for this rather curious term. "Gapless" is basically
"the ability to play one song followed by another song without introducing additional gaps or silence"
Obvious really. It's something that was a standard feature on all music formats and playback devices - vynyl, cassette, CD - until the rise of modern digital music players. Something we took for granted as standard for over 60 years is now an optional extra.

Be warned: this post mightwill turn into a bit of a rant. Gapless playback is something I care about a lot. It's been an absolute deal-breaker with my last four digital music player purchases. It's technically possible, it should just be the minimum acceptable standard.

I'm not going to list all the various gapless solutions and guilty parties on this post, if gapless playback is something that concerns you, do the research.

Disclaimer: gapless isn't an issue all the time, only if you're listening to albums. If you think the album format is dead and music must be listened to as individual songs, shuffled or compiled into playlists, stop reading. Otherwise...

What's the big deal?


If you're thinking "but all my albums have gaps between the songs anyway, what's the big deal", well what about live albums, dance music, prog rock records, etc? Some random examples of bands with studio albums that require gapless playback: The Beatles (Sgt. Pepper, Abbey Road), Pink Floyd (Dark Side of the Moon, The Wall), Dream Theater (Six Degrees, Systematic Chaos), The Prodigy (The Fat of the Land), Wu-Tang Clan (Forever), Nine Inch Nails (Pretty Hate Machine, The Downward Spiral), Slayer (Reign in Blood), Tool (Lateralus), Linkin Park (Meteora, A Thousand Suns), My Chemical Romance (Danger Days).

OK, the Beatles probably were wrong to start the whole "album format" thing without considering the limitations of future music players, but we're stuck with a larger number of albums that the average portable player can't handle. Oops.

Gapless doesn't mean "no gaps"


Yes it's confusing. "Gapless" doesn't mean "no gaps between songs", just "no added gaps between songs". So, if we take the Beatles as an example, Revolver has long gaps between the songs on the record, but Sgt. Pepper and Abbey Road let the songs seamlessly flow into each other. Gapless playback recreates the record exactly as it was.

OK, I'm converted. I want gapless. How do I get it?

  1. Use a "gapless" format eg. OGG, FLAC, MP3 (*)
  2. Buy a "gapless" player eg. iTunes/iPod
*Not all MP3s are created equal
Oh, and just because your format is gapless, doesn't mean your player will handle it. My Sony phone plays OGG files, but it leaves a massive gap between them. Spotify also apparently has issues playing its OGG files gaplessly. However, there are gapless-capable formats for both lossy and lossless, and music players capable of handling them. Gapless playback is available if you want it.

Why is gapless so hard to do?


Well, on vynyl/tape/CD, gapless is built into the format - it's a continuous stream of music, and "tracks" are nothing more than index markers you can fast-forward to. Where digital music is concerned, each track is a separate file, to be unpacked (if compressed) and re-combined into the album/playlist running order.

So really, why is gapless so hard to do?


It's not that hard. Many formats manage to store the necessary information. However, playback requires a little thought. Only a little.
  1. Buffering 101: you need a very basic knowledge of buffering - you need to be uncompressing a track slightly ahead of playing it. If you were to build a music player that:
    1. Played first track (slight delay as the music starts buffering) exactly as it is on the CD
    2. Waited until it finished then thought "oh, there's more?" and went off to fetch the next track
    3. Played second track...
    ...and so on, you'd probably get gaps due to disc access, buffering, etc, creating a time interval of greater than 0.0 seconds between tracks. Remember, those tracks already have whatever gaps (or "no gaps") existed on the CD.

  2. Track Length: The track must know when it begins and ends - astonishingly, MP3s can't be relied on to know how long they are (the original specification only stored "roughly" how long a track was, so you often ended up with the track stored as a number of "frames", the last of which contained the end of the song plus some silence to pad it out), although modern encoders seem to do fine.
To play gaplessly, you need to basically treat your tracks as contributing to a seamless playlist, sort of like re-creating a CD on the fly.

But surely if gapless was a problem they'd have fixed it by now?


MP3s have been around for years now. The original specification didn't address gapless playback, although subsequent revisions (and decent encoders like the latest LAME) now allow for gapless (it's not guaranteed that MP3s you buy will be gapless though). And subsequent formats (specifically AAC) based on MP3 repeated the same problem. When apple got so fed up with the situation they first fixed it (for iTunes/iPods only, of course) with a hack for not-necessarily-gapless MP3s that was rightly announced as a major new iPod feature. In 2007.

Apple's hack was basically to figure out how long the track should be (the info that OGG, FLAC etc files keep and MP3s originally threw away) so it can be played gaplessly. There's space in an MP3 to store this info (again, modern encoders create gapless files), but as gapless is not part of the original MP3 spec, no guarantees your player will manage to playback properly.

Getting gapless on non-gapless players


A couple of unsatisfactory hacks:
  • The 'Single Track' hack - OK, you could join all the songs on a CD together into one very long track (apple used to offer a 'join tracks' mode in the old pre-gapless iTunes days) but would you really want to?
  • Crossfading - by having your tracks fade-out and fade-in, slightly overlapping, you eliminate gaps. Of course, you also eliminate any sudden powerful track start/end that should be there, any pauses that should be there, etc. Save it for DJ mixes - crossfading is not gapless.

My 20-Year Turntable / Tape Deck / CD Player does Gapless - surely my shiny new MP3 player does too?


Why did gaps ever appear? Why hasn't the gapless problem been completely eradicated? My guess is that people either don't notice or don't care enough to choose a different player, so the extra effort needed to allow gapless playback isn't considered necessary. People buy individual songs or listen to their own playlists. For many, the convenience of the ubiquitous MP3 format far outweighs its many drawbacks (poor sound quality, inefficient compression, no automatic gapless). It took apple six years to get round to fixing this. Sony used to offer gapless (albeit via ATRAC only) but abandoned it along with their hard-drive players. Spotify considered it such a low priority that they took forever to implement it (and their "free" mode is still flaky).

So if you care, do the research and buy gapless. Or just put up with your player/format adding extra gaps between songs.

Note: updated to cover Spotify etc. finally getting gapless.

Wednesday, December 15, 2010

Digital Music: Format Wars

Which format should you save your tunes in? If your automatic answer is "MP3", it's worth reviewing your options.

There are two basic choices:
  1. Lossless ie. CD quality eg. FLAC, Apple Lossless, AIFF, WAV
  2. Lossy eg. MP3, AAC, OGG, ATRAC, WMA
Lossy compression is based on the idea that actually, you could throw away the stuff that people tend not to hear, and get a decent approximation of the original for a fraction of the file size.

The ideal is lossless, it's better quality and future-proofed. The really awesome bit is that if you go the lossless route, you can get the lossy version, in multiple different formats (including some not yet invented) for free. Note that not all lossless formats are compressed - FLAC and apple lossless compress, but WAVs don't.

One other thing - most formats allow tracks to be "tagged" (ie. all the track title, number, artist, album, year, singer's dog's name info stored in every file). WAV seems to be the only major exception - all you can rely on with WAV is what you can squeeze into the filename.

Pros and Cons or Lossy vs Lossless


Lossless (eg. FLAC)

Pros:
  • High quality - it's CD quality, because it's a perfect copy with nothing thrown away
  • Future-proofed - you can easily convert to whatever lossy or lossless format best suits the music player you're going to buy in two years' time

Cons:
  • Not universally supported (but hey, you can just convert)
  • Takes up space (but disc space is cheap, and you can easily spit out a portable version for your MP3 player)

Lossy (eg. MP3)

Pros:
  • OK quality (it's a compromise for space)
  • Convenience - you can buy music in MP3 format RIGHT NOW! CDs require a postman or a walk to the store
  • Small size - they fit on your MP3 player

Cons:
  • Sound quality is sacrificed - OK for headphones or small speakers, but not on a decent system
  • Transcoding to a different format is basically out - if your chosen format/bitrate doesn't work for you or your player, you gotta re-buy or re-rip


Other Stuff


Sound Quality Considerations

Ever thought "MP3 is good enough", "there's no difference between MP3 and CD" or even "MP3 sounds better"?

First off, are you comparing like for like? Lets assume you're comparing a CD and an MP3 ripped from the same CD. And to be super-scientific, you disguise which is which. Part of the design of MP3 is to throw away part of the sound, the parts that don't seem very significant. Every time I've done these tests, heavy (or actually not-so-heavy) bass tends to give away the MP3.

The problem is, sometimes "good enough" isn't good enough. On small speakers (eg. laptop, iPod dock) or headphones, sure, MP3s will do, you probably won't notice a difference. On large hifi speakers, you almost certainly will. Your ears. Your future buying decisions. Your choice.

What Bitrate?

Bitrate indicates the available data bandwidth (typically in "kilobits per second"), and therefore the quality. If the music has been compressed into a lossy format, bitrate is a good indicator of quality (higher the better). For lossless music, any bitrate value is only an indication of file size, there's no actual music compression going on.

All format/bitrate decisions are going to be a trade-off between what sounds good to you and the file size. Personally, I need full lossless quality in the house, 160kbps AAC is fine for headphones when working/commuting. But then I choose to have the luxury of being able to switch my portable copy to a different format/bitrate at the drop of a batch script.

It's worth noting that different formats have different compression algorithms and possibly different performance. Do some tests at various bitrates to see what works for you. My settings preferences for a portable copy are basically: 132kbps ATRAC = 160kbps AAC = 160kbps OGG = 192kbps MP3.

Just for comparison with lossy formats, lossless files run at a bitrate of about 1400kbps for the raw WAV, but in terms of filesize, this can be compressed down to almost half that before you need to apply lossy compression.

Constant vs Variable Bitrate

Pretty straightforward for lossy compression. Constant bitrate just uses a uniform bitrate throughout, you can predict how big your files are going to be, every second of music gets the same attention whether it's silence or mayhem. Variable bitrate compression tries to achieve an average bitrate, but allocates more or less of the "bit budget" depending on how busy things get (so you can't predict exactly how big a four-minute music file will be, but that big silent gap before the hidden track will cost nothing to store). Look for the "CBR" or "VBR" settings when selecting your encoding preferences.

Doesn't apply to lossless formats - while some formats offer more efficient storage than others, there's no compression of the actual music.

Gapless Playback

One extra complication is "gapless playback", or the ability to play successive tracks without the player introducing extra pauses between songs. Scarily, there is a term for this. Many formats (MP3/AAC) and players (eg. Sony) are unable to manage this due to a mixture of format flaws and lazy coding. If you ever experienced advanced audio technologies like CD and cassette tape, trying to listen to an album on an average MP3 player requires a major downgrading of expectations. I rant about this at length on this post.