Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [audio]

Code relating to sound recording, playback, and manipulation of audio data and hardware.

Filter by
Sorted by
Tagged with
5
votes
1answer
939 views

HTML and jQuery audio player

I had a task to create simple audio player. So far I managed to do functionalities and all that is needed. Other part of same task was to make it semantic and modular. I read some blog posts and ...
5
votes
1answer
4k views

Playing sound in JavaFX when button is pressed, window pops up

So I made a class for playing a sound in JavaFX when a button is pressed, a window pops up... I don't know about the quality of the code though. I don't know if I used the best way to play the sound. ...
5
votes
0answers
955 views

Android audio recording using AudioRecord and ByteBuffer

I'm developing an audio recorder app for android using AudioRecord class to have a low level access to audio samples. ...
4
votes
3answers
287 views
4
votes
4answers
3k views

For-loop for mixing audio (left channel, stereo to mono)

This is a very simple for loop, but I find it very, complex-looking. I hope you can give me some insight on how it may be improved. ...
4
votes
2answers
172 views

Writing computer generated music to a wav.file in C - follow-up 2

See the previous iteration. What's new: endianness is now handled more gracefully (only one endianness check, and convertion if need be) and music is more funky. ...
4
votes
1answer
935 views

Morse code string - follow-up 2

This is my second follow-up. Major changes made: Use a Map instead of an enum for the Morse characters Added ...
4
votes
1answer
400 views

The sheet music of Morning Mood

While learning to play the keyboard, I find it helpful to write down the score of the pieces I play, regardless of whether a score already exists. The code is written using Frescobaldi as IDE and ...
4
votes
1answer
653 views

MP3 player for Linux

I wrote a Python MP3 player for Linux using PyGame, with a curses GUI and a mouse-only interface. It's purely for personal use. It hasn't been polished yet, but for now I'd like to know what I've ...
4
votes
1answer
651 views

Playing different audio files based on video keyframe

The general idea of this function is to load a different sound file depending on current time position of the video. I have the following information about audio files: ...
4
votes
1answer
353 views

Identify audio using Gracenote

This script records audio from the computer's output and passes it to a C program that fingerprints it and queries the Gracenote database. If it identifies the audio then it offers options to look it ...
4
votes
1answer
49 views

Script to fix audio level

I need to fix and maintain the master volume in PulseAudio (so that I don't blow up my speakers). E.g. call gfaaudio -v 25 to fix volume at 25%. Is there a cleaner ...
4
votes
1answer
72 views

Convert to and from variable length quantities

As part of small MIDI library i've implemented the conversion of a VLQ (variable length quantity) for byte[] -> bigint and ...
4
votes
1answer
111 views

Audio frequency trainer / tester using Web Audio API

I'm making an audio frequency trainer as a learning exercise. It could be useful for audio technicians who need to recognize audio frequencies (eg. when ringing out feedback during a live concert or ...
4
votes
0answers
392 views

Sound recorder, based on sdl2

This is my first Haskell program, a command-line sdl-based(so, hopefully, cross-platform), parameter-less sound recorder. Tutorials, articles or chapters that concern mistakes in my code are just as ...
4
votes
0answers
207 views

SSE optimisation for audio resampling [closed]

I'm learning SSE for the first time and trying to optimise some code. Using oprofile shows that the CPU usage in this function went down from 2.5% to 0.9% using the ...
3
votes
2answers
2k views

Python Text-To-Speech program

I have some code that asks for a user input, and then uses TTS to convert that into speech and play the file. It then asks the user whether they want to repeat it and convert another input into speech,...
3
votes
3answers
264 views

Generate sinusoid as Wave file

This is a little program to show how a WAVe-File Generator could be written. It use a Function-Object "SinFunction" to calculate the value of any point of the amplitude in time. This object and two ...
3
votes
2answers
12k views

Converting audio to different file formats

I have this code that converts audio to different file formats: ...
3
votes
2answers
1k views

Playing pure sinusoidal tones

I wrote a simple sound player to use as part of my MorseString class. I am new to using sounds (in fact, I was helped a lot by Google) and I don't know if this is ...
3
votes
1answer
121 views

Sound Control System

This is my sound system that allows for the following functionality: One master volume that controls every sound. A function to stop/pause every playing sound A function to control every instance of ...
3
votes
1answer
5k views

TrackBar volume control

This changes the application's volume through the Trackbar (1-100, 1% to 100%): ...
3
votes
1answer
460 views

Simple GTK GUI for the command line program auCDtect

I'm trying to write a simple GTK GUI for the command line program auCDtect. It is supposed to take .flac files, convert them to .wav temporarily, pass the to the auCDtect command line program to check ...
3
votes
1answer
975 views

Download a list of songs from Youtube using Selenium

Given a text file containing a list of links, I wrote some code to download them, one by one, from YouTube, using either YoutubeMP3 or Convert2mp3 logging any songs that failed to download. The code ...
3
votes
1answer
1k views

Serving a growing audio file with Django

I would like to serve a growing audio file (raw PCM audio for now) with the possibility of seeking. I tried to manage it with Apache, but in the end wasn't able to achieve what I wanted. Now I ...
3
votes
1answer
226 views

Simple audio playback system

I am trying to optimize my game written in Java and I used the VisualVM launcher for profiling and monitoring my game. What caught me by surprise was that my basic utility to play sound effects was ...
3
votes
2answers
2k views

FIFO queue for audio data

I have created a data structure to handle some audio data I am generating (simple sine wave right now). It had some errors in it due to some misunderstanding of my ancient C knowledge that has been ...
3
votes
1answer
3k views

Simple audio player to play music using a URL built using MediaPlayer in Android

I wanted to create a very basic application for Android that plays an audio file based on a URL input. I would like it to be reviewed based on good programming practices. This is the first time that I ...
3
votes
1answer
2k views

Python .WAV generator

The following is a .wav file generator that I wrote briefly while (re)learning about audio sampling: ...
3
votes
1answer
285 views

FFT Frequency Shifter Extravaganza

I've been writing a frequency shifter in C++ for an Audio Unit plugin. The best way for me to do this while keeping a large amount of other algorithms working in the same plugin was by writing a ...
3
votes
1answer
371 views

AudioController class for managing audio in Unity games

I'm looking for a critique of this audio management system I wrote for Unity games. It references a JSON file to trigger the clips by events. The main AudioController.cs class is pasted below. The ...
3
votes
1answer
400 views

Encoding variable-length quanties for MIDI

I was reading about the MIDI spec and I challenged myself to implement a function to convert an int32 to a variable length quantity uint32. I didn't look it up or ...
3
votes
1answer
70 views

Improving fading functions

Regarding these two functions, which do the same thing... Large and confusing: ...
3
votes
0answers
128 views

Converts audio files to fixed size chunks and the chunks to spectrogram images

This code takes in input as audio files (.wav or .WAV) and divides them into fixed-size (chunkSize in seconds) samples. Then these chunks are converted to spectrogram images after applying PCEN (Per-...
3
votes
0answers
494 views

Using arecord through subprocess to record in Raspberry Pi

I am using arecord through subprocess to record in raspberry pi : press joystick button to start recording and press button again to stop recording. I am really a noob in programming. ...
3
votes
0answers
80 views

Live radio streamer

I've posted a repo on a live radio streamer much like shoutcast/icecast without admin panels / user panels or custom mounts. I was wondering if anyone could review it and tell me what I can do better ...
3
votes
0answers
461 views

Pitch detection library, basic architecture

I'm a mechanical engineer/amateur programmer trying to learn modern C++. I'm working on a personal project where I'm building a library that uses PortAudio to abstract some basic audio processing, ...
2
votes
4answers
274 views

Modulating an oscillator by gain, pitch, and offset

I've an Audio Host application that sends block of samples to a DLL I'm building. It sends 44100 samples per seconds (i.e. Sample Rate 44100hz), per block, processing 16 distinct Voices. It ...
2
votes
2answers
4k views

Music player in Swift

I made a simple mp3 player that plays, pauses and stops a given song, shows the time elapsed, and has a volume control. I read the documentation and can't figure out the difference between the ...
2
votes
2answers
141 views

Rhythm game finger trainer

Decided to make a small C# console based rhythm game finger trainer with lots of user definable options. I'm very much a beginning programmer, so thought I might learn a lot from it. Especially when ...
2
votes
2answers
495 views

Processing voice samples

I'm within an audio application that sends variable-length buffers to my DLL, which will process at higher speed (48000 samples per sec, but can also be higher). Here's the code I've written: ...
2
votes
1answer
1k views

Encoding a list of frequencies as WAV audio

This code gets a list of signals with predefined frequency from struc.num I need to encode it to wave format, so i use this code. This works, but i dont sure it is a correct decision to encode like ...
2
votes
1answer
482 views

Converting an input audio file to a monophonic FLAC file

I have the following method which basically converts an input audio file to a monophonic FLAC file. Now I am getting Member has cyclomatic complexity of 21 (105%) message in Visual Studio, while I've ...
2
votes
1answer
45 views

Playing a sound depending on the currently displayed flash card image

I've developed a fully working flash card app for kids. It has a UIImageView that cycles through 26 cards (abcs) via a gesture click and a music button that will ...
2
votes
1answer
82 views

ngCordova plugin for audio player

I wrote a Cordova plugin for an app that I'm working on, and now I'm trying to write an Angular definition to wrap my plugin. So far, I've followed the model in ng-cordova.js: ...
2
votes
1answer
2k views

Prepend data to stream in C#

I'm working on an XNA project that loads several resources that are packed into a single file. XNA can take a WAV file stream and turn that into a SoundEffect (seen below in "case ".wav""). Since ...
2
votes
1answer
213 views

Web Audio Constructors and jQuery

I'm trying to figure out a way to have cleaner, efficient code for a web audio project i've been working on. the code I have right now is this: ...
2
votes
1answer
2k views

Ring buffer in C tail pointer issue (for audio streaming)

I am currently writing an embedded application for audio streaming purposes. The embedded app will receive audio packets being sent over WiFi, buffer the packets, then send the audio data over to a ...
2
votes
1answer
777 views

Audio scrubber slider bar

I'm trying to improve the quality/efficiency of my coding (having only been learning jQuery for a couple of months). I have a function which loops through all ...
2
votes
1answer
139 views

CommandLine StreamFormatTester

Using Chris Adamson's book Learning Core Audio I'm getting familiar with Core Audio for Mac/iOS. The code examples are 100% Objective-C. I'm trying to follow along using Swift 3. This small piece of ...