Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active August 21, 2023 22:20
Show Gist options
  • Save mcsee/fd1c07ce153817a5572cb3cb84ae1007 to your computer and use it in GitHub Desktop.
Save mcsee/fd1c07ce153817a5572cb3cb84ae1007 to your computer and use it in GitHub Desktop.
class Mp3Converter {
convertToMp3(source, mimeType) {
if(mimeType.equals("audio/mpeg")) {
this.convertMpegToMp3(source)
} else if(mimeType.equals("audio/wav")) {
this.convertWavToMp3(source)
} else if(mimeType.equals("audio/ogg")) {
this.convertOggToMp3(source)
} else if(...) {
// Lots of new clauses
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment