Skip to content

Unable to add sound for opengl renderer #2144

Open
@k4pran

Description

@k4pran

Description of bug / unexpected behavior

When going through cairo's tests the below one failed that was testing sound, it doesn't seem to have implemented some of cairo's logic to add sound to a movie file.

I was trying to run the following test with opengl:

def test_add_sound(using_opengl_renderer, tmpdir):
    # create sound file
    sound_loc = Path(tmpdir, "noise.wav")
    f = wave.open(str(sound_loc), "w")
    f.setparams((2, 2, 44100, 0, "NONE", "not compressed"))
    for _ in range(22050):  # half a second of sound
        packed_value = struct.pack("h", 14242)
        f.writeframes(packed_value)
        f.writeframes(packed_value)

    f.close()

    scene = Scene()
    scene.add_sound(sound_loc)

Which results in

AttributeError: 'OpenGLRenderer' object has no attribute 'time'

Expected behavior

How to reproduce the issue

Code for reproducing the problem
class Example(Scene):
    def construct(self):
        self.add_sound("path/to/soundfile")

Additional media files

Images/GIFs

Logs

Terminal output
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR

System specifications

System Details
  • OS (with version, e.g Windows 10 v2004 or macOS 10.15 (Catalina)):
  • RAM:
  • Python version (python/py/python3 --version):
  • Installed modules (provide output from pip list):
PASTE HERE
LaTeX details
  • LaTeX distribution (e.g. TeX Live 2020):
  • Installed LaTeX packages:
FFMPEG

Output of ffmpeg -version:

PASTE HERE

Additional comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue:bugSomething isn't working... For use in issuesopenglConcerning the OpenGL renderer.

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions