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
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. ...
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 ...
1
vote
1answer
847 views

Android music-streaming app

This is my first time building an Android app or even using Java in the first place. All of this code does work, but I'm hoping to optimize it or find out if things could be done more easily than how ...
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 ...
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 ...
3
votes
1answer
359 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 ...
4
votes
1answer
340 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 ...
1
vote
0answers
188 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
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 ...
0
votes
1answer
65 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
112 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
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: ...
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: ...
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 ...
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 ...
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 ...
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 ...
4
votes
2answers
170 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
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 ...
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 ...
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 ...
3
votes
1answer
119 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 ...
1
vote
1answer
157 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
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 ...
3
votes
1answer
225 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
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 ...
18
votes
2answers
1k views

A Nightmare on setTimeout Street

I have script which plays audio, shows/hides elements: ...
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. ...
3
votes
1answer
397 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 ...
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 ...
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 ...
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
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 ...
1
vote
0answers
122 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
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
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)? ...
3
votes
2answers
981 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
930 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 ...
1
vote
3answers
416 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
100 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 ...
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 ...
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 ...
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 ...
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? ...
3
votes
1answer
70 views

Improving fading functions

Regarding these two functions, which do the same thing... Large and confusing: ...
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 ...
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 ...
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
0answers
202 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
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 ...