class_docstr: Reads raw audio data from any audio file that Gstreamer
  knows how to decode.
  
      >>> with GstAudioFile('something.mp3') as f:
      >>>     print f.samplerate
      >>>     print f.channels
      >>>     print f.duration
      >>>     for block in f:
      >>>         do_something(block)
  
  Iterating the object yields blocks of 16-bit PCM data. Three
  pieces of stream information are also available: samplerate (in Hz),
  number of channels, and duration (in seconds).
  
  It's very important that the client call close() when it's done
  with the object. Otherwise, the program is likely to hang on exit.
  Alternatively, of course, one can just use the file as a context
  manager, as shown above.
class_docstr_tok: ["Reads","raw","audio","data","from","any","audio","file","that","Gstreamer","knows","how","to","decode",".",">",">",">","with","GstAudioFile","(","'something.mp3","'",")","as","f",":",">",">",">","print","f.samplerate",">",">",">","print","f.channels",">",">",">","print","f.duration",">",">",">","for","block","in","f",":",">",">",">","do_something","(","block",")","Iterating","the","object","yields","blocks","of","16-bit","PCM","data",".","Three","pieces","of","stream","information","are","also","available",":","samplerate","(","in","Hz",")",",","number","of","channels",",","and","duration","(","in","seconds",")",".","It","'s","very","important","that","the","client","call","close","(",")","when","it","'s","done","with","the","object",".","Otherwise",",","the","program","is","likely","to","hang","on","exit",".","Alternatively",",","of","course",",","one","can","just","use","the","file","as","a","context","manager",",","as","shown","above","."]
docstr: The callback for the sinkpad's "notify::caps" signal.
          
code: def _notify_caps(self, pad, args):
      """The callback for the sinkpad's "notify::caps" signal."""
      # The sink has started to receive data, so the stream is ready.
      # This also is our opportunity to read information about the
      # stream.
      self.got_caps = True
      info = pad.get_current_caps().get_structure(0)
  
      # Stream attributes.
      self.channels = info.get_int("channels")[1]
      self.samplerate = info.get_int("rate")[1]
  
      # Query duration.
      success, length = pad.get_peer().query_duration(Gst.Format.TIME)
      if success:
          self.duration = length / 1000000000
      else:
          self.read_exc = MetadataMissingError("duration not available")
  
      # Allow constructor to complete.
      self.ready_sem.release()
  
imports: import gi
  from gi.repository import GLib, Gst
  import sys
  import threading
  import os
  import queue
  from urllib.parse import quote
  from .exceptions import DecodeError
  from .base import AudioFile
label_desc: Use image node_id 2 for calling the GstAudioFile obj's underlying member method code with example usage: obj._notify_caps(pad, args) without return types