class_docstr: Represents in-memory audio data of a certain (convertible) representation.
  
  Attributes
  ----------
  audio_type : str
      See `__init__`.
  audio_format : util.audio.AudioFormat
      See `__init__`.
  audio : binary
      Audio data represented as indicated by `audio_type`
  duration : float
      Audio duration of the sample in seconds
class_docstr_tok: ["Represents","in-memory","audio","data","of","a","certain","(","convertible",")","representation",".","Attributes","--","--","--","--","--","audio_type",":","str","See","`","__init__","`",".","audio_format",":","util.audio.AudioFormat","See","`","__init__","`",".","audio",":","binary","Audio","data","represented","as","indicated","by","`","audio_type","`","duration",":","float","Audio","duration","of","the","sample","in","seconds"]
docstr: In-place conversion of audio data into a different representation.
  
  Parameters
  ----------
  new_audio_type : str
      New audio-type - see `__init__`.
  bitrate : int
      Bitrate to use in case of converting to a lossy audio-type.
docstr_tok: ["In-place","conversion","of","audio","data","into","a","different","representation",".","Parameters","--","--","--","--","--","new_audio_type",":","str","New","audio-type","-","see","`","__init__","`",".","bitrate",":","int","Bitrate","to","use","in","case","of","converting","to","a","lossy","audio-type","."]
code: def change_audio_type(self, new_audio_type, bitrate=None):
      """
      In-place conversion of audio data into a different representation.
  
      Parameters
      ----------
      new_audio_type : str
          New audio-type - see `__init__`.
      bitrate : int
          Bitrate to use in case of converting to a lossy audio-type.
      """
      if self.audio_type == new_audio_type:
          return
      if (
          new_audio_type == AUDIO_TYPE_PCM
          and self.audio_type in SERIALIZABLE_AUDIO_TYPES
      ):
          self.audio_format, audio = read_audio(
              self.audio_type, self.audio
          )
          self.audio.close()
          self.audio = audio
      elif (
          new_audio_type == AUDIO_TYPE_PCM
          and self.audio_type == AUDIO_TYPE_NP
      ):
          self.audio = np_to_pcm(self.audio, self.audio_format)
      elif new_audio_type == AUDIO_TYPE_NP:
          self.change_audio_type(AUDIO_TYPE_PCM)
          self.audio = pcm_to_np(self.audio, self.audio_format)
      elif new_audio_type in SERIALIZABLE_AUDIO_TYPES:
          self.change_audio_type(AUDIO_TYPE_PCM)
          audio_bytes = io.BytesIO()
          write_audio(
              new_audio_type,
              audio_bytes,
              self.audio,
              audio_format=self.audio_format,
              bitrate=bitrate,
          )
          audio_bytes.seek(0)
          self.audio = audio_bytes
      else:
          raise RuntimeError(
              'Changing audio representation type from "{}" to "{}" not supported'.format(
                  self.audio_type, new_audio_type
              )
          )
      self.audio_type = new_audio_type
  
imports: import collections
  import ctypes
  import io
  import math
  import numpy
  import os
  import pyogg
  import tempfile
  import wave
  from .helpers import LimitingPool
  from collections import namedtuple
  from .io import open_remote, remove_remote, copy_remote, is_remote_path
label_desc: Use image node_id 2 for calling the Sample obj's underlying member method code with example usage: obj.change_audio_type(new_audio_type, bitrate) without return types