Skip to content

Sounddevice doesn't release memory #158

@AutomCoding

Description

@AutomCoding

After stopping an audio playback, sounddevice doesn't release the used data from memory. If the audio file is a few minutes long, more than a gigabyte of RAM has been devoured after four or five play/stop cycles.

import sounddevice
import numpy
from scipy.io.wavfile import read
import time


a = read("audiofile.wav")

# Repeat the following lines a few times
sounddevice.play(numpy.array(a[1], dtype=float), a[0])
time.sleep(5)
sounddevice.stop()
time.sleep(2)

I'm using Python 3.7 on Windows 7 (64 bit) and all libraries are up to date.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions