.. module:: twilio.rest.resources ================ Recordings ================ For more information, see the `Recordings REST Resource `_ documentation. Audio Formats ----------------- Each :class:`Recording` has a few special methods. To get the url for the wav format of this recording, use :meth:`Recording.wav`. For the mp3 format, use :meth:`Recording.mp3`. To make requests for either of these formats use the same method with a '!' appended. These methods both take a block to be executed as soon as the response returns. Listing Your Recordings ---------------------------- The following code will print out the :attr:`duration` for each :class:`Recording`. .. code-block:: ruby require 'twilio-ruby' # To find these visit https://www.twilio.com/user/account account_sid = "ACXXXXXXXXXXXXXXXXX" auth_token = "YYYYYYYYYYYYYYYYYY" @client = Twilio::REST::Client.new account_sid, auth_token @client.recordings.list().each do |recording| puts recording.duration You can filter recordings by CallSid by passing the Sid as :attr:`call`. Filter recordings using :attr:`before` and :attr:`after` dates. The following will only show recordings made before January 1, 2011. .. code-block:: ruby require 'twilio-ruby' # To find these visit https://www.twilio.com/user/account account_sid = "ACXXXXXXXXXXXXXXXXX" auth_token = "YYYYYYYYYYYYYYYYYY" @client = Twilio::REST::Client.new account_sid, auth_token @client.recordings.list(before=date(2011,1,1)).each do |recording|: puts recording.duration Deleting Recordings --------------------- The :class:`Recordings` resource allows you to delete unnecessary recordings. .. code-block:: ruby require 'twilio-ruby' # To find these visit https://www.twilio.com/user/account account_sid = "ACXXXXXXXXXXXXXXXXX" auth_token = "YYYYYYYYYYYYYYYYYY" @client = Twilio::REST::Client.new account_sid, auth_token @client.recordings.get("RC123").delete() Accessing Related Transcptions ------------------------------- The :class:`Recordings` allows you to retrieve associated transcriptions. The following prints out the text for each of the transcriptions associated with this recording. .. code-block:: ruby require 'twilio-ruby' # To find these visit https://www.twilio.com/user/account account_sid = "ACXXXXXXXXXXXXXXXXX" auth_token = "YYYYYYYYYYYYYYYYYY" @client = Twilio::REST::Client.new account_sid, auth_token @recording = @client.recordings.get("RC123") @recording.transcriptions.list().each do |transcription| puts transcription.transcription_text