Questions tagged [audio]

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

Filter by
Sorted by
Tagged with
43
votes
5answers
6k views

Writing computer generated music to a .wav file in C

See the next iteration. I wrote this simple C program for writing computer generated music to a WAV file over three years ago. I refactored it a little, but it does not look good to me. Any ...
34
votes
5answers
5k views

Recording Audio Continuously in C

As an ongoing little side project of mine, I've been working on recording audio in c. You can the code's progression by looking at past versions (V1.0, V2.0). I've found that my past versions were ...
30
votes
4answers
15k views

Recording audio in C

Please note there are newer revisions of this code, one here, and one here for continuous audio recording. This is a program I wrote as a .wav audio recording library for Linux. It was developed on ...
18
votes
2answers
1k views

A Nightmare on setTimeout Street

I have script which plays audio, shows/hides elements: ...
18
votes
1answer
208 views

Musical Fizzbuzz

I wrote some code using ChucK : Strongly-timed, Concurrent, and On-the-fly Music Programming Language and would like a review. I broke down the logic into a number of classes, all of which are shown ...
17
votes
5answers
6k views

Using sounds in Java

I'm trying to apply sound today, and the goal in mind was a simple violin tuner. The actionListener seems repetitive/ How might I optimize it (what I tried just ...
17
votes
2answers
1k views

Split mp3 of album into individual tracks

Recently, I've been transferring some of my old vinyl records to MP3 files. One of the things I did to make some progress was to automate things, so I initially set things up so that it would record ...
14
votes
0answers
395 views

Shepard Tone stream generation in Clojure

This is my work to generate an infinite Shepard Tone. It is written in Clojure and works by generating repeating streams of incrementing frequencies, converting those to values on a sine wave and then ...
13
votes
2answers
186 views

Flac Converter And Organizer

I really like flac files, but my phone can't store them all. So I made a script for converting them, that slowly became a full featured flac organizer. I'd like to improve my programming skills, as ...
12
votes
2answers
888 views

Speech Recognition Part 1: Generate Training Data

You've all heard of neural nets, no? One of the "hello world"s of neural nets is OCR with the MNIST dataset. My idea for speech recognition is to train the neural net with short labeled spectrograms ...
11
votes
1answer
4k views

Play some sine waves with SDL2

Runs smoothly, however valgrind is showing "possibly lost: 544 bytes in 2 blocks". This is my first time doing a lot of things here so I might be making multiple mistakes. Please let me know if ...
11
votes
1answer
88 views

Improved Sound Control System

After a bit of work, I've changed my code a lot from the previous question: I was recommended by George Mauer and schism to make a better structural design, so hopefully this new build is a bit ...
10
votes
1answer
344 views

Bash Music Player 2

This post is a follow-up to this. I wanted further reviews since the code I provided became too old when I got replies, which is why I'm providing it again here. I'm hoping I could get reviews for ...
10
votes
2answers
207 views

Keyboard music maker

I enjoy making silly programs every once in a while. This is one of them. It makes nice sounding notes that vary slightly depending on the key being entered into a ...
10
votes
4answers
464 views

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

See the previous and initial iteration. See the next iteration. Now I have refactored the code according to many suggestions made in the first iteration. What's new: I attempted to deal with ...
9
votes
4answers
5k views

Sound manager for Android

I created a singleton class for managing sound effects on Android. This class will only be instanced and loaded once at the beginning, and each activity will use the loaded songs. I don't know either ...
9
votes
1answer
2k views

Piano app in Swift

I'm making my first app in Swift: a Piano app. I'd like to get your feedback especially about how I can make codes shorter. I maybe have to use arrays and loops and something, and searched by myself ...
9
votes
3answers
15k views

Very Basic Java Piano

I've been reading "Head First Java" and some of the early projects surround basic swing and basic MIDI. So I've put the two together and written a basic "Synthesiser"/"Piano" using what I have ...
9
votes
1answer
1k views

Recording audio in C 2.0

I posted my audio recording program to Code Review before, and received a stern review along with the other reviews that caused me to rewrite the entire code base. Here is what I would like reviewed: ...
9
votes
1answer
580 views

Raw PCM to FLAC conversion using QtGstreamer in C++

This is part of my kynnaugh-cc TeamSpeak 3 plugin implementing speech recognition for deaf/hearing-impaired users. One of the self-contained classes in my code has the job of converting incoming PCM ...
8
votes
1answer
678 views

Simple Java MIDI player followup

This is my second iteration of a simple Java MIDI player. I've made several amendments and would like to see if the code is now correctly implemented and readable. This follows on from the first ...
8
votes
1answer
488 views

Hiding message within an audio file with entropy detection

i'm currently making an application using python to hide a message in an audio file (WAV only for now). The hiding itself is done pretty quickly and without any problems, but i want to calculate the ...
7
votes
3answers
686 views

Karplus Strong pluck generation

I want to use a simple implementation of the Karplus-Strong algorithm to generate pluck sounds and chords. My existing code seems correct but is slow when more than a few plucks are being generated. ...
7
votes
3answers
1k views

Morse code translator GUI

I made a Morse code translator in Java in which a user inputs a word/words into a text field and the program converts it to Morse code and beeps the Morse code. I have a feeling that my code could be ...
7
votes
1answer
90 views

Python script audibly represents itself

I was just messing around with python making wav files; when I came up with this (what I think is) pretty neat script. It takes each character and represents it ...
7
votes
1answer
84 views

Warped Audio Sample

I was asked this question and got no feedback, so I'd like to ask you for any feedback on my solution, Thanks! Think of an audio sample as a rubber-band that you want to pin to a musical time ruler. ...
7
votes
1answer
3k views

Beat detection algorithm implementation

What is the quality of the code I've written? Is it easy to read or is it a low-quality piece of code? Also, is there any way I can improve the algorithm itself (beside changing C parameters)? ...
7
votes
1answer
106 views

Parse a WAV file and export PCM data

I'm a newbie and I wrote code that gets a WAV file and exports a RAW (only PCM data) to *.raw file. But I am confused about the structure. The code is written as one procedure (LISP style) and there ...
6
votes
5answers
263 views

Convert FLAC files to MP3 in parallel on Ubuntu

I created a script to convert my FLAC music collection to MP3. I did this so that I can play the MP3 files in my car, as the integrated head unit only supports MP3 and WMA files. The script works on ...
6
votes
2answers
15k views

Basic C++ tone generator

I'm trying to learn C++ (with experience in C and Java, inter alia). I wrote a program to output a waveform of multiple (superimposed) tones, each varying in pitch. To execute: Compilation: ...
6
votes
2answers
1k views

Android audio player

I want to implement basic audio functions like play, stop and pause. I have stuffed all the code inside onCreate method. Is this best practise to follow? ...
6
votes
2answers
410 views

A baby monitor using a Raspberry Pi to send push notifications when triggered by noise

I have a Raspberry Pi 3B with a USB microphone. I have used a combination of Bash and Python scripts to detect noise levels above a certain threshold that trigger a notification on my phone. The ...
6
votes
2answers
193 views

Performance of speech enhancement code for Android app

I wrote a speech enhancement code for an Android App. The algorithm runs on 256 size frames of voice samples. On my PC the code runs per about 5ms per frame, while on my Nexsus 5 it more like 50ms per ...
6
votes
1answer
2k views

Playing MIDI instruments in Java

This program offers 8 notes C, D, ..., A, B, C on keyboard keys 1, 2, ..., 8. Also, by typing Left or Right, you can cycle over MIDI instruments. KeyboardPiano.java: ...
6
votes
1answer
265 views

Speech Recognition Part 2: Classifying Data

Now that I have generated training data, I need to classify each example with a label to train a TensorFlow neural net (first building a suitable dataset). To streamline the process, I wrote this ...
6
votes
1answer
3k views

Music player written in Python using PyQt

Some days ago, in the middle of a flight, in one hour or so, I've written this basic music player using Python3 and PyQt4. I needed some easy to use music player, so I decided to write this piece of ...
6
votes
1answer
12k views

Audio player in Angular 2

I just built an audio player in Angular 2 using a player component and a player service. It's all working fine, I just feel like there is a much better way to do this. Should the audio object be in ...
6
votes
1answer
874 views

Simple Java MIDI player

I created a simple program that allows you to create and play MIDI sounds. I've used the MVC approach and I’d like to know if there are any improvements to be made regarding the design and structure ...
5
votes
2answers
928 views

A struct for recording audio samples

I am writing a program in c++ to record audio. Here are my structure and code snippet. ...
5
votes
2answers
753 views

A Note class which plays a note and stops it after specific period of time

This code plays a note for a specific period of time using NAudio.dll 1.3.8. ...
5
votes
1answer
773 views

Bash Music Player

I have finally finished creating my first real project. It's just a simple music player that can provides the user with the latest music from any site (as long as it contains MP3 files) he provides ...
5
votes
2answers
239 views

Random tone generator using Web Audio API

This is a random frequency audio generator made with the Web Audio API by Mozilla. The end-goal is an audio frequency trainer: the website plays an audio frequency and the user tries to guess which ...
5
votes
4answers
478 views

Audio player for a website

I'm fairly new to jQuery and have decided to make a jQuery audio player for a website. There are two versions of the way it selects the audio: Here Here I removed some basic, not connected with the ...
5
votes
1answer
241 views

Comparing FFTs to deduplicate IVR recordings

I've got a Python script that traverses two file trees, checking all .wav files for duplication. I'm still an undergrad, and have never worked with audio before. I'm not entirely sure this is going ...
5
votes
2answers
398 views

Optimizing a Text-To-Speech program with a lot of repetition

I have a Text-To-Speech program that will ask the user to input text, convert it to speech and then output that speech from within Pygame by loading the file into memory, getting Pygame to play the ...
5
votes
1answer
726 views

Random MP3 Selector and Player

So, I am either a glutton for punishment, or I have no life, but I wrote a script to answer a question over on Ask Ubuntu as a solution for selecting a random MP3 file in a given directory, and ...
5
votes
1answer
1k views

HTML5 audio player with CSS-styled interface for pages with multiple MP3 sources

This is one of my first JavaScript projects. It works (at least in Firefox and Chrome), but I would like to know if this code follows common best practices. This script is supposed to look for ...
5
votes
2answers
136 views

Fetch real-time audio input

The following code uses portAudio library to implement a real-time audio input through default input device. The SAMPLE format is float32 with 100 samples per frame. The code is able to provide ...
5
votes
1answer
69 views

JQuery Clyp Auto-embed

This function finds links from Clyp.it and offers users a link to embed the content. Please let me know what you think of it. It works, but probably has some redundancies and inefficiencies. <...
5
votes
1answer
915 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 ...