import encoders
import decoders
import config
import tempfile
import os

def transcode(inF, outF, options, type=None):
    "Transcodes a file"
    if type == None:
        type = os.path.splitext(outF)[1][1:].lower()
    #Get the file's metadata
    meta = decoders.getMetadata(inF)
    #Decode the file
    f = tempfile.NamedTemporaryFile()
    inF_real = decoders.decode(inF, f.name)
    if not inF_real:
        return False

    #Encode it
    succ = encoders.encode(inF_real, outF, type, options, meta)
    #Clean up
    f.close()
    return succ

import encoders
import decoders
import config
import tempfile
import os

def transcode(inF, outF, options, type=None):
    "Transcodes a file"
    if type == None:
        type = os.path.splitext(outF)[1][1:].lower()
    #Get the file's metadata
    meta = decoders.getMetadata(inF)
    #Decode the file
    f = tempfile.NamedTemporaryFile(suffix=".wav")
    inF_real = decoders.decode(inF, f.name)
    if not inF_real:
        return False

    #Encode it
    succ = encoders.encode(inF_real, outF, type, options, meta)
    #Clean up
    f.close()
    return succ

Make sure that the temporary file has a `wav` extension because a certain encoder was designed for Windows and thinks that you would never possibly have a file without an extension so adds `.wav` if it's not there on the input file
Make sure that the temporary file has a `wav` extension because a certain encoder was designed for Windows and thinks that you would never possibly have a file without an extension so adds `.wav` if it's not there on the input file
  import encoders
  import decoders
  import config
  import tempfile
  import os
  
  def transcode(inF, outF, options, type=None):
      "Transcodes a file"
      if type == None:
          type = os.path.splitext(outF)[1][1:].lower()
      #Get the file's metadata
      meta = decoders.getMetadata(inF)
      #Decode the file
-     f = tempfile.NamedTemporaryFile()
+     f = tempfile.NamedTemporaryFile(suffix=".wav")
      inF_real = decoders.decode(inF, f.name)
      if not inF_real:
          return False
  
      #Encode it
      succ = encoders.encode(inF_real, outF, type, options, meta)
      #Clean up
      f.close()
      return succ
  
Make sure that the temporary file has a `wav` extension because a certain encoder was designed for Windows and thinks that you would never possibly have a file without an extension so adds `.wav` if it's not there on the input file
## Code Before:
import encoders
import decoders
import config
import tempfile
import os

def transcode(inF, outF, options, type=None):
    "Transcodes a file"
    if type == None:
        type = os.path.splitext(outF)[1][1:].lower()
    #Get the file's metadata
    meta = decoders.getMetadata(inF)
    #Decode the file
    f = tempfile.NamedTemporaryFile()
    inF_real = decoders.decode(inF, f.name)
    if not inF_real:
        return False

    #Encode it
    succ = encoders.encode(inF_real, outF, type, options, meta)
    #Clean up
    f.close()
    return succ

## Instruction:
Make sure that the temporary file has a `wav` extension because a certain encoder was designed for Windows and thinks that you would never possibly have a file without an extension so adds `.wav` if it's not there on the input file
## Code After:
import encoders
import decoders
import config
import tempfile
import os

def transcode(inF, outF, options, type=None):
    "Transcodes a file"
    if type == None:
        type = os.path.splitext(outF)[1][1:].lower()
    #Get the file's metadata
    meta = decoders.getMetadata(inF)
    #Decode the file
    f = tempfile.NamedTemporaryFile(suffix=".wav")
    inF_real = decoders.decode(inF, f.name)
    if not inF_real:
        return False

    #Encode it
    succ = encoders.encode(inF_real, outF, type, options, meta)
    #Clean up
    f.close()
    return succ
