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

learn more… | top users | synonyms

0
votes
0answers
24 views

HTML5 audio executing callbacks determined by currentTime value

I wanted to be able to run code snippets at a certain time in an audio sound track using html5 audio. I created a little JavaScript object that creates the audio tag and appends its to the document ...
1
vote
0answers
25 views

JavaScript sound manager (singleton / static object using observer pattern)

I have some JavaScript code i would like your feedback on please. My goals: SoundManager should be a singleton/static class that has one instance. ...
2
votes
2answers
142 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 ...
0
votes
1answer
56 views

Playing audio from two data sources

I want to play some audio of two byte arrays. I was wondering whether it would be better to play them as two separate arrays both calling the method, or to put them into one array and play it from ...
1
vote
4answers
80 views

JS form verification

I have three checboxes in my form. I have to check which one is checked and start the action. What do you think? Is this the easiest way of doing it? Checkbox 1 = cat Checkbox 2 = dog Checkbox 3 = ...
6
votes
1answer
116 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: ...
2
votes
1answer
53 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: ...
5
votes
4answers
289 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 ...
3
votes
1answer
124 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 ...
2
votes
1answer
119 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 ...
15
votes
1answer
117 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 ...
0
votes
1answer
45 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. ...
10
votes
4answers
275 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 ...
32
votes
5answers
3k 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 ...
11
votes
1answer
78 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 ...
3
votes
1answer
76 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 ...
1
vote
1answer
83 views

Organize dynamic HTML generation function for audio player

I have some code that's part of my music-js library, and most of it is very organized, using object-oriented design for my AudioAnalyser and ...
5
votes
1answer
147 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 ...
3
votes
1answer
86 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 ...
10
votes
2answers
118 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 ...
14
votes
2answers
207 views

A Nightmare on setTimeout Street

I have script which plays audio, shows/hides elements: ...
4
votes
2answers
126 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. ...
3
votes
1answer
81 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 ...
26
votes
5answers
2k views

Recording Audio Continuously in C

As an ongoing little side project of mine, I've been working on recording audio with the C language. You can see a progression of my code by looking at my past two versions (V1.0, V2.0). I've ...
7
votes
1answer
338 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 ...
6
votes
2answers
3k 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
1answer
232 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 ...
1
vote
0answers
63 views

Web Audio Oscillator Waveform

I'm currently working with Web Audio for creating a simple synth like project in the browser and implementing controls for the Oscillators via jQuery/jQueryUI: ...
7
votes
1answer
68 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 ...
6
votes
1answer
354 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)? ...
3
votes
2answers
250 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 ...
4
votes
1answer
431 views

Follow-up 2 to Morse Code String

This is my second follow-up. Major changes made: Use a Map instead of an enum for the Morse Characters Added ...
1
vote
3answers
151 views

AudioMetaTagger: recursively read files and gather metadata

So the idea is to read metadata recursively in a chosen directory, load their metadata and display it into a table. Here is the simplified example of what I am doing. ...
-3
votes
1answer
91 views

Count percentage of audio samples exceeding a threshold

I have this practice question that I have an answer to: In this stage of the project, you will identify any "danger" spots, in which the SPL is greater than or equal to 80 dB (the value above ...
10
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 ...
6
votes
2answers
124 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 ...
4
votes
1answer
41 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 ...
6
votes
2answers
493 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? ...
3
votes
1answer
68 views

Improving fading functions

Regarding these two functions, which do the same thing... Large and confusing: ...
8
votes
3answers
5k 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 ...
14
votes
5answers
4k 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 ...
4
votes
4answers
1k 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
0answers
131 views

SSE optimisation for audio resampling

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 ...
10
votes
1answer
285 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 ...
4
votes
1answer
338 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 ...
2
votes
1answer
161 views

Optimizing playlist processing

I am trying to process an audio library file which is about 350 KB. My application processes each song on the file gets its meta-data and displays it in a List Box. The problem is that it takes too ...
8
votes
1answer
207 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: ...
7
votes
4answers
3k 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 ...
11
votes
1answer
2k 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 ...
24
votes
4answers
6k views

Recording audio in C

This is a program I wrote as a .wav audio recording library for Linux. It was developed on a Raspberry Pi, so that may affect the dependencies required.(1) wav.h ...