audio

Use FFMPEG to export audios with gaps filled

偶尔善良 提交于 2021-01-28 10:01:02
问题 I have a MKV file with gaps in the audio. That is, there are gaps in the MKV audio track timestamps. According to "ffmpeg", the AC3 audio length is 802 seconds, but when exporting the audio to WAV, the resulting file length is 801'53 seconds. That is, the "exported" audio is shorter. Triaging the issue with ffmpeg -i INPUT.mkv -af ashowinfo -map 0:2 -y -frames:a XXXX -f alaw /dev/null I can confirm that the length difference is consistent with gaps in the timestamps of the original audio

Web Audio API: Layout to Achieve Panning for an Arbitrary Number of Sources

只愿长相守 提交于 2021-01-28 09:20:30
问题 I am trying to achieve user-controlled panning for any number of simultaneous web audio sources. The sources themselves are mono. I'm working in Javascript with the web audio API (https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API). Currently, the problem I'm running into is that I'm trying to use a multi-channel output (one for each source), but the channel interpretation is overriding my attempts at panning (see https://developer.mozilla.org/en-US/docs/Web/API/AudioNode

Playing WAV file in Chrome fails

百般思念 提交于 2021-01-28 08:47:04
问题 I'm writing web application where users can listen audio (WAV) files using soundmanager2. Application is running on Amazon micro instance, but static files are served from my university server. Everything seemed to work fine, but I encountered problem with playing audio from Chrome browser but ONLY when files are served from university server. The same file served from Amazon server works fine in all browsers. If you want to test I paste links bellow. Amazon (APACHE) - works on all browsers:

Capturing Audio signals in Qt

我的未来我决定 提交于 2021-01-28 08:11:46
问题 I was wondering if it is possible to capture a copy of the audio output in Qt so I can process it. Here they said it's possible to monitor the playback, but I think it's only possible if you use a self made music player, which I don't want. I want to capture the signal from no matter where it is player (youtube, spotify, facebook, etc.). Is there a way to analyze this data with Qt? Is it possible to set my output of my soundcard as a QMediaSource? Thank you in advance. 回答1: In general, no,

How to specify the noise floor in FFmpeg's acompressor filter

末鹿安然 提交于 2021-01-28 06:33:18
问题 I've always used Audacity's Dynamic Range Compressor if I wanted to crank up the volume of an audio file. Today I was looking at whether I could do the same with FFmpeg's acompressor filter. I've found "how to user "compressor" with ffmpeg" and Gyan's answer, which was really helpful, but not satisfying enough. Right now I'm actually trying to mimic Audacity's procedure. If I understand the acompressor correctly, then I can't apply the makeup gain in one pass. So I need to do a volumedetect

Updating/appending to a .wav file in Python

[亡魂溺海] 提交于 2021-01-28 05:23:02
问题 I have a stream of PCM audio frames coming into my Python script, and I am able to save blocks of these frames as .wav files as such: def update_wav(): filename = "test.wav" wav_file = wave.open(filename, "wb") n_frames = len(audio) wav_file.setparams((n_channels, sample_width, sample_rate, n_frames, comptype, compname)) for sample in audio: wav_file.writeframes(struct.pack('h', int(sample * 32767.0))) wav_file.close() However, I'd like this to continually update as new frames come in. Is

No audio with SDL/C++

半城伤御伤魂 提交于 2021-01-28 05:11:05
问题 void LoadMusic(string path); Mix_Music* gMusic = NULL; LoadMusic("Music/bubble-bobble.mp3"); if(Mix_PlayingMusic() == 0) { Mix_PlayMusic(gMusic, -1); } if(Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048) < 0) { cout << "Mixer could not initialise. error: " << Mix_GetError(); return false; } Mix_FreeMusic(gMusic); gMusic = NULL; void LoadMusic(string path) { gMusic = Mix_LoadMUS(path.c_str()); if(gMusic == NULL) { cout << "Failed to load background music! Error: " << Mix_GetError() << endl; }

Share audio file from the res/raw folder thorugh Share Intent in Android

為{幸葍}努か 提交于 2021-01-28 04:53:10
问题 I'm trying to share an audio file from my res/raw folder. What I've done so far is: Uri uri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.sound); //parse path to uri Intent share = new Intent(Intent.ACTION_SEND); //share intent share.setType("audio/*"); share.putExtra(Intent.EXTRA_STREAM, uri); startActivity(Intent.createChooser(share, "Share sound to")); When I choose to share it on GMail, for example, it says something like "Failed to attach empty file". Looks like I'm

Play selected audio while pausing/resetting others

左心房为你撑大大i 提交于 2021-01-28 04:29:38
问题 I have two audio elements that play through a button's click event. I've successfully managed to pause one if another is selected but also need to set the paused element back to 0.0 seconds (i.e pause and reset). I'm aware that Javascript currently doesn't have a stop() method which led assume that this would be done by setting its currentTime to 0 . If so I just haven't been able to figure out the best way to incorporate this method in my code. Right now I'm pausing all audio elements in the

Mojave/macOS 10.14.0: [AVPlayerItem duration] is always indefinite

我的梦境 提交于 2021-01-28 02:26:06
问题 I'm trying to read the duration of a locally stored audio file using the following code: #import <Foundation/Foundation.h> #import <CoreMedia/CoreMedia.h> #import <AVFoundation/AVFoundation.h> AVPlayer *player = [AVPlayer playerWithURL: urlForLocalAudioFile]; // busy wait - I know, not elegant, please ignore int timeout = 0; while (([player status] == AVPlayerStatusUnknown || [[player currentItem] status] == AVPlayerItemStatusUnknown) && timeout < 100) { [NSThread sleepForTimeInterval: 0.1];