audio

IPython.display doesn't show long wav files

IPython.display doesn't show long wav files Question: I use IPython.display for listening audio file in Jupyter notebook. I have a long file(30 min). import IPython.display as dis import numpy y = numpy.zeros(30*60*48000) This code work as fluidly for 5 seconds dis.display(dis.Audio(y[:5*48000], rate=48000)) but for 30 minutes the code hangs and there are no errors. dis.display(dis.Audio(y, …

Total answers: 1

Play sound on button click in PyQt6

Play sound on button click in PyQt6 Question: I am trying to create 2 buttons that would play a sound once and endlessly. But at this stage it is not possible to reproduce the sound at all. What am I doing wrong? import sys from PyQt6.QtCore import QUrl from PyQt6.QtMultimedia import QMediaPlayer, QAudioOutput from PyQt6.QtWidgets …

Total answers: 1

How to crop an audio file based on the timestamps present in a list

How to crop an audio file based on the timestamps present in a list Question: So, I have an audio file which is very long in duration. I have manual annotations (start and end duration in seconds) of the important parts which I need from the whole audio in a text file. I have converted …

Total answers: 1

How to generate heartbeat sounds in Python given beats per minute?

How to generate heartbeat sounds in Python given beats per minute? Question: I’m looking to pass in an integer beats per minute (bpm) variable value (e.g. 62) into a function in Python that outputs the accompanying heartbeat noises (i.e. 62 heart beat sounds in a minute). I can’t find any libraries that can help with …

Total answers: 1

failed to hear audio on jupyter with librosa but can with scipy – sampling rate issues?

failed to hear audio on jupyter with librosa but can with scipy – sampling rate issues? Question: I can hear audio in jupyter if loaded with scipy. However, I can hear untill 192000 sampling rate. If I set to 192001 or above, I cannot hear anything. from IPython.display import Audio from scipy.io.wavfile import read wave_filename …

Total answers: 1

Pygame MIDI Playback in PaaS from Dockerfile

Pygame MIDI Playback in PaaS from Dockerfile Question: The Problem: I am currently deploying a Python Flask App using a Dockerfile on a PaaS (Heroku like). The User Story is as follows: User Clicks ‘Generate MIDI’ MIDI is generated and User can (on the same page): ‘Download MIDI’ (currently works perfectly locally & PaaS deployment) …

Total answers: 1

Getting Youtube Audio Stream with yt_dlp, NOT using pafy

Getting Youtube Audio Stream with yt_dlp, NOT using pafy Question: I have made a GUI youtube audio player. It uses pafy, a library that gets the stream-urls of a given youtube url. This is wonderful, but pafy has 2 problems; one is that it, since at least half a year, has an error because it …

Total answers: 1

Video Recording is too fast in opencv python

Video Recording is too fast in opencv python Question: I’m capturing my screen using OpenCV on windows. It works fine but when I try to play my captured video it plays too fast. i.e. I capture from video for 60 seconds but when I play it OpenCV recorded longer and sped up to fit the …

Total answers: 1

Play multiple sounds with same timestamp

Play multiple sounds with same timestamp Question: I am writing an AB listenning test app that can play multiple audio files with a shared timestamp. Say I have two audio files loaded which have the same length, when I start to play sound, I click a button to switch between these two files every several …

Total answers: 1

Programmatically accessing PTS times in MP4 container

Programmatically accessing PTS times in MP4 container Question: Background For a research project, we are recording video data from two cameras and feed a synchronization pulse directly into the microphone ADC every second. Problem We want to derive a frame time stamp in the clock of the pulse source for each camera frame to relate …

Total answers: 1