Sound Operators

bpy.ops.sound.bake_animation()

Updates the audio animation cache so that it’s up to date

bpy.ops.sound.mixdown(filepath="", check_existing=True, filter_blender=False, filter_image=False, filter_movie=False, filter_python=False, filter_font=False, filter_sound=True, filter_text=False, filter_btx=False, filter_collada=False, filter_folder=True, filemode=9, display_type='FILE_DEFAULTDISPLAY', accuracy=1024, container='FLAC', codec='FLAC', format='S16', bitrate=192)

Mixes the scene’s audio to a sound file

Parameters:
  • filepath (string, (optional)) – File Path, Path to file
  • check_existing (boolean, (optional)) – Check Existing, Check and warn on overwriting existing files
  • filter_blender (boolean, (optional)) – Filter .blend files
  • filter_image (boolean, (optional)) – Filter image files
  • filter_movie (boolean, (optional)) – Filter movie files
  • filter_python (boolean, (optional)) – Filter python files
  • filter_font (boolean, (optional)) – Filter font files
  • filter_sound (boolean, (optional)) – Filter sound files
  • filter_text (boolean, (optional)) – Filter text files
  • filter_btx (boolean, (optional)) – Filter btx files
  • filter_collada (boolean, (optional)) – Filter COLLADA files
  • filter_folder (boolean, (optional)) – Filter folders
  • filemode (int in [1, 9], (optional)) – File Browser Mode, The setting for the file browser mode to load a .blend file, a library or a special file
  • display_type (enum in [‘FILE_DEFAULTDISPLAY’, ‘FILE_SHORTDISPLAY’, ‘FILE_LONGDISPLAY’, ‘FILE_IMGDISPLAY’], (optional)) –

    Display Type

    • FILE_DEFAULTDISPLAY Default, Automatically determine display type for files.
    • FILE_SHORTDISPLAY Short List, Display files as short list.
    • FILE_LONGDISPLAY Long List, Display files as a detailed list.
    • FILE_IMGDISPLAY Thumbnails, Display files as thumbnails.
  • accuracy (int in [1, inf], (optional)) – Accuracy, Sample accuracy, important for animation data (the lower the value, the more accurate)
  • container (enum in [‘FLAC’, ‘OGG’, ‘WAV’], (optional)) –

    Container, File format

    • FLAC flac, Free Lossless Audio Codec.
    • OGG ogg, Xiph.Org Ogg Container.
    • WAV wav, Waveform Audio File Format.
  • codec (enum in [‘FLAC’, ‘PCM’, ‘VORBIS’], (optional)) –

    Codec, Audio Codec

    • FLAC FLAC, Free Lossless Audio Codec.
    • PCM PCM, Pulse Code Modulation (RAW).
    • VORBIS Vorbis, Xiph.Org Vorbis Codec.
  • format (enum in [‘U8’, ‘S16’, ‘S24’, ‘S32’, ‘F32’, ‘F64’], (optional)) –

    Format, Sample format

    • U8 U8, 8 bit unsigned.
    • S16 S16, 16 bit signed.
    • S24 S24, 24 bit signed.
    • S32 S32, 32 bit signed.
    • F32 F32, 32 bit floating point.
    • F64 F64, 64 bit floating point.
  • bitrate (int in [32, 512], (optional)) – Bitrate, Bitrate in kbit/s
bpy.ops.sound.open(filepath="", filter_blender=False, filter_image=False, filter_movie=True, filter_python=False, filter_font=False, filter_sound=True, filter_text=False, filter_btx=False, filter_collada=False, filter_folder=True, filemode=9, relative_path=True, display_type='FILE_DEFAULTDISPLAY', cache=False, mono=False)

Load a sound file

Parameters:
  • filepath (string, (optional)) – File Path, Path to file
  • filter_blender (boolean, (optional)) – Filter .blend files
  • filter_image (boolean, (optional)) – Filter image files
  • filter_movie (boolean, (optional)) – Filter movie files
  • filter_python (boolean, (optional)) – Filter python files
  • filter_font (boolean, (optional)) – Filter font files
  • filter_sound (boolean, (optional)) – Filter sound files
  • filter_text (boolean, (optional)) – Filter text files
  • filter_btx (boolean, (optional)) – Filter btx files
  • filter_collada (boolean, (optional)) – Filter COLLADA files
  • filter_folder (boolean, (optional)) – Filter folders
  • filemode (int in [1, 9], (optional)) – File Browser Mode, The setting for the file browser mode to load a .blend file, a library or a special file
  • relative_path (boolean, (optional)) – Relative Path, Select the file relative to the blend file
  • display_type (enum in [‘FILE_DEFAULTDISPLAY’, ‘FILE_SHORTDISPLAY’, ‘FILE_LONGDISPLAY’, ‘FILE_IMGDISPLAY’], (optional)) –

    Display Type

    • FILE_DEFAULTDISPLAY Default, Automatically determine display type for files.
    • FILE_SHORTDISPLAY Short List, Display files as short list.
    • FILE_LONGDISPLAY Long List, Display files as a detailed list.
    • FILE_IMGDISPLAY Thumbnails, Display files as thumbnails.
  • cache (boolean, (optional)) – Cache, Cache the sound in memory
  • mono (boolean, (optional)) – Mono, Mixdown the sound to mono
bpy.ops.sound.open_mono(filepath="", filter_blender=False, filter_image=False, filter_movie=True, filter_python=False, filter_font=False, filter_sound=True, filter_text=False, filter_btx=False, filter_collada=False, filter_folder=True, filemode=9, relative_path=True, display_type='FILE_DEFAULTDISPLAY', cache=False, mono=True)

Load a sound file as mono

Parameters:
  • filepath (string, (optional)) – File Path, Path to file
  • filter_blender (boolean, (optional)) – Filter .blend files
  • filter_image (boolean, (optional)) – Filter image files
  • filter_movie (boolean, (optional)) – Filter movie files
  • filter_python (boolean, (optional)) – Filter python files
  • filter_font (boolean, (optional)) – Filter font files
  • filter_sound (boolean, (optional)) – Filter sound files
  • filter_text (boolean, (optional)) – Filter text files
  • filter_btx (boolean, (optional)) – Filter btx files
  • filter_collada (boolean, (optional)) – Filter COLLADA files
  • filter_folder (boolean, (optional)) – Filter folders
  • filemode (int in [1, 9], (optional)) – File Browser Mode, The setting for the file browser mode to load a .blend file, a library or a special file
  • relative_path (boolean, (optional)) – Relative Path, Select the file relative to the blend file
  • display_type (enum in [‘FILE_DEFAULTDISPLAY’, ‘FILE_SHORTDISPLAY’, ‘FILE_LONGDISPLAY’, ‘FILE_IMGDISPLAY’], (optional)) –

    Display Type

    • FILE_DEFAULTDISPLAY Default, Automatically determine display type for files.
    • FILE_SHORTDISPLAY Short List, Display files as short list.
    • FILE_LONGDISPLAY Long List, Display files as a detailed list.
    • FILE_IMGDISPLAY Thumbnails, Display files as thumbnails.
  • cache (boolean, (optional)) – Cache, Cache the sound in memory
  • mono (boolean, (optional)) – Mono, Mixdown the sound to mono
bpy.ops.sound.pack()

Pack the sound into the current blend file

bpy.ops.sound.unpack(method='USE_LOCAL', id="")

Unpack the sound to the samples filename

Parameters:
  • method (enum in [‘USE_LOCAL’, ‘WRITE_LOCAL’, ‘USE_ORIGINAL’, ‘WRITE_ORIGINAL’], (optional)) – Method, How to unpack
  • id (string, (optional)) – Sound Name, Sound datablock name to unpack
bpy.ops.sound.update_animation_flags()

Update animation flags

Previous topic

Sketch Operators

Next topic

Surface Operators