audio

Python + winsound - check whether an audio file is being played

佐手、 提交于 2021-02-04 07:30:23
问题 Is there a way to check whether an audio file is being played using winsound? The idea is that music is played in the background while the user can input data via the terminal. In order to achieve this I decided to use SND_ASYNC. The thing is though, once the file is finished playing I want it to play another audio file but I have no means of checking when the audio file is actually done playing. I suppose I could check how long the audio file is and play a different song based on that but I

Play swift sound based on each duration of I time in array

北城余情 提交于 2021-01-29 20:43:51
问题 I want my swift code to call the playSound and play the sound based for the duration of each item in array playamount. So I want the user to play the sound for the first time for 10 seconds then play the sound starting at the beginning for 20 and then the same thing for 30 seconds. So the sound always starts at the beginning each time it is called. import UIKit; import AVFoundation class ViewController: UIViewController { var player: AVAudioPlayer? func playSound() { let url = Bundle

audio file sounds bad/noisy after passing through low pass filter

时光毁灭记忆、已成空白 提交于 2021-01-29 18:57:18
问题 I am trying to pass my audio through low pass filter, so as to filter out noise from it. However, the output of the wav is very noisy, and I am unable to understand why. Find the original and filtered wav and their resp. spectrograms below link. enter link description here The code I have used is: #https://stackoverflow.com/questions/25191620/creating-lowpass-filter-in-scipy-understanding-methods-and-units import numpy as np from scipy.signal import butter, lfilter, freqz, filtfilt from

Pass audio file as microphone input with python

人走茶凉 提交于 2021-01-29 15:42:24
问题 I want to make a soundboard program for my friends and myself with a few meme sounds we find funny. I already have a working base with one button, that plays the desired sound. Now I just need to figure out a way how to make the audio play through my microphone (simulate microphone input). I already searched the internet and didn't find the exact solution I was looking for. Here is the code I already have: import tkinter as tk import pygame root = tk.Tk() root.title("Soundboard"); root

How to stream MP3 chunks given a NumPy array in Python?

让人想犯罪 __ 提交于 2021-01-29 14:41:44
问题 I'm struggling to find a solution for streaming synthesized audio from a Python server. The synthesized audio is incrementally generated and returned as a np.float32 NumPy array. It then needs to be transformed from a NumPy array into an MP3 chunk. Finally, the MP3 chunk is served via flask . Here is some pseudo-code: import numpy from flask import Flask from flask import Response app = Flask(__name__) sample_rate = 24000 def pcm_to_mp3(): raise NotImplementedError() def get_synthetic_audio()

WebAudio API: Is It Possible to Export an AudioBuffer with StereoPanner Node Data?

天大地大妈咪最大 提交于 2021-01-29 13:00:29
问题 I'm looking to export an AudioBuffer to a wav file with a StereoPanner node i.e. I pan a sound all the left and export it panned to the left. I'm wondering if it is possible to export the StereoPanner data associated with an AudioContext? I have built an AudioSource from an AudioContext, and I have attached an StereoPanner to my AudioSource. I'm able to pan my sound in-browser without issue, and I'm also able to export my AudioBuffer to a file (wav). Unfortunately, when I export my

How to play different sound consecutively and asynchronously in python?

房东的猫 提交于 2021-01-29 12:08:58
问题 To be specific, I need to play sound in a while loop which is fast to execute. And the audio needs to be played separately. I've tried various functions/libraries: playsound, winsound, vlc. But none of them meet my demand. Either the sounds are overlapped, or I need to wait for the sound to finish to continue the next line of code, which blocks the whole process, making the program running with unbearable lags. Matters in playsound, winsound, vlc: playsound: has block option but will block

WebAudio API: Is It Possible to Export an AudioBuffer with StereoPanner Node Data?

元气小坏坏 提交于 2021-01-29 11:50:40
问题 I'm looking to export an AudioBuffer to a wav file with a StereoPanner node i.e. I pan a sound all the left and export it panned to the left. I'm wondering if it is possible to export the StereoPanner data associated with an AudioContext? I have built an AudioSource from an AudioContext, and I have attached an StereoPanner to my AudioSource. I'm able to pan my sound in-browser without issue, and I'm also able to export my AudioBuffer to a file (wav). Unfortunately, when I export my

Detecting Specific Sounds (Frequencies) with Python

点点圈 提交于 2021-01-29 11:30:30
问题 I want to record sound of a machine and want to detect if its present in another sound file that I record. I am able to record the sound of the machine and the sound file that I want to detect its presence. I am also able to take fft of the sound files, however I dont know If I should check specific frequencies or check it in time intervals. Can I implement it with aubio or is there another way? silent room silent room + sound 来源: https://stackoverflow.com/questions/53305661/detecting

How to take metadata from .mp3 file and put it to a video as a text using FFmpeg?

百般思念 提交于 2021-01-29 11:23:01
问题 In my previously opened topic: How to make FFmpeg automatically inject mp3 audio tracks in the single cycled muted video I've got detailed explanation from @llogan how to broadcast looped short muted video on youtube automatically injecting audio tracks in it without interrupting a translation. I plan to enhance the flow and the next question I faced with is how to dynamically put an additional text to the broadcast. Prerequisites: youtube broadcast is up and running by ffmpeg short 3 min