class_docstr: Create an audio object.
  
  When this object is returned by an input cell or passed to the
  display function, it will result in Audio controls being displayed
  in the frontend (only works in the notebook).
  
  Parameters
  ----------
  data : numpy array, list, unicode, str or bytes
      Can be one of
  
        * Numpy 1d array containing the desired waveform (mono)
        * Numpy 2d array containing waveforms for each channel.
          Shape=(NCHAN, NSAMPLES). For the standard channel order, see
          http://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx
        * List of float or integer representing the waveform (mono)
        * String containing the filename
        * Bytestring containing raw PCM data or
        * URL pointing to a file on the web.
  
      If the array option is used the waveform will be normalized.
  
      If a filename or url is used the format support will be browser
      dependent.
  url : unicode
      A URL to download the data from.
  filename : unicode
      Path to a local file to load the data from.
  embed : boolean
      Should the audio data be embedded using a data URI (True) or should
      the original source be referenced. Set this to True if you want the
      audio to playable later with no internet connection in the notebook.
  
      Default is `True`, unless the keyword argument `url` is set, then
      default value is `False`.
  rate : integer
      The sampling rate of the raw data.
      Only required when data parameter is being used as an array
  autoplay : bool
      Set to True if the audio should immediately start playing.
      Default is `False`.
  
  Examples
  --------
  ::
  
      # Generate a sound
      import numpy as np
      framerate = 44100
      t = np.linspace(0,5,framerate*5)
      data = np.sin(2*np.pi*220*t) + np.sin(2*np.pi*224*t))
      Audio(data,rate=framerate)
  
      # Can also do stereo or more channels
      dataleft = np.sin(2*np.pi*220*t)
      dataright = np.sin(2*np.pi*224*t)
      Audio([dataleft, dataright],rate=framerate)
  
      Audio("http://www.nch.com.au/acm/8k16bitpcm.wav")  # From URL
      Audio(url="http://www.w3schools.com/html/horse.ogg")
  
      Audio('/path/to/sound.wav')  # From file
      Audio(filename='/path/to/sound.ogg')
  
      Audio(b'RAW_WAV_DATA..)  # From bytes
      Audio(data=b'RAW_WAV_DATA..)
class_docstr_tok: ["Create","an","audio","object",".","When","this","object","is","returned","by","an","input","cell","or","passed","to","the","display","function",",","it","will","result","in","Audio","controls","being","displayed","in","the","frontend","(","only","works","in","the","notebook",")",".","Parameters","--","--","--","--","--","data",":","numpy","array",",","list",",","unicode",",","str","or","bytes","Can","be","one","of","*","Numpy","1d","array","containing","the","desired","waveform","(","mono",")","*","Numpy","2d","array","containing","waveforms","for","each","channel",".","Shape=","(","NCHAN",",","NSAMPLES",")",".","For","the","standard","channel","order",",","see","http",":","\/\/msdn.microsoft.com\/en-us\/library\/windows\/hardware\/dn653308","(","v=vs.85",")",".aspx","*","List","of","float","or","integer","representing","the","waveform","(","mono",")","*","String","containing","the","filename","*","Bytestring","containing","raw","PCM","data","or","*","URL","pointing","to","a","file","on","the","web",".","If","the","array","option","is","used","the","waveform","will","be","normalized",".","If","a","filename","or","url","is","used","the","format","support","will","be","browser","dependent",".","url",":","unicode","A","URL","to","download","the","data","from",".","filename",":","unicode","Path","to","a","local","file","to","load","the","data","from",".","embed",":","boolean","Should","the","audio","data","be","embedded","using","a","data","URI","(","True",")","or","should","the","original","source","be","referenced",".","Set","this","to","True","if","you","want","the","audio","to","playable","later","with","no","internet","connection","in","the","notebook",".","Default","is","`","True","`",",","unless","the","keyword","argument","`","url","`","is","set",",","then","default","value","is","`","False","`",".","rate",":","integer","The","sampling","rate","of","the","raw","data",".","Only","required","when","data","parameter","is","being","used","as","an","array","autoplay",":","bool","Set","to","True","if","the","audio","should","immediately","start","playing",".","Default","is","`","False","`",".","Examples","--","--","--","--",":",":","#","Generate","a","sound","import","numpy","as","np","framerate","=","44100","t","=","np.linspace","(","0,5",",","framerate","*","5",")","data","=","np.sin","(","2","*","np.pi","*","220","*","t",")","+","np.sin","(","2","*","np.pi","*","224","*","t",")",")","Audio","(","data",",","rate=framerate",")","#","Can","also","do","stereo","or","more","channels","dataleft","=","np.sin","(","2","*","np.pi","*","220","*","t",")","dataright","=","np.sin","(","2","*","np.pi","*","224","*","t",")","Audio","(","[","dataleft",",","dataright","]",",","rate=framerate",")","Audio","(","``","http",":","\/\/www.nch.com.au\/acm\/8k16bitpcm.wav","''",")","#","From","URL","Audio","(","url=","''","http",":","\/\/www.w3schools.com\/html\/horse.ogg","''",")","Audio","(","'\/path\/to\/sound.wav","'",")","#","From","file","Audio","(","filename='\/path\/to\/sound.ogg","'",")","Audio","(","b'RAW_WAV_DATA","..",")","#","From","bytes","Audio","(","data=b'RAW_WAV_DATA","..",")"]
docstr: shortcut for returning metadata with url information, if defined
docstr_tok: ["shortcut","for","returning","metadata","with","url","information",",","if","defined"]
code: def _data_and_metadata(self):
      """shortcut for returning metadata with url information, if defined"""
      md = {}
      if self.url:
          md["url"] = self.url
      if md:
          return self.data, md
      else:
          return self.data
  
imports: from os.path import exists, isfile, splitext, abspath, join, isdir
  from os import walk, sep
  from IPython.core.display import DisplayObject
label_desc: Use image node_id 4 for calling the Audio obj's underlying member method code with example usage: obj._data_and_metadata() and returns: self,  md, self