I've tried to use an at91-sama5d2 and an max9880 codec. Since drivers where lacking I've written my own driver and now finally got sound. However it sounds really bad, see:
Sound quality example
I'm failing to identify the error here. What kind of error makes this sound so bad?
Related
I am working on some voice recognition software as my first Haskell project. I am looking for something something that could work cross-platform. My plan is as follows:
Record audio as a .wav file
Use https://hackage.haskell.org/package/flac to convert the .wav file to a FLAC file.
Send a speech API request to Google's Speech API (as can be seen here https://cloud.google.com/speech/docs/quickstart).
Receive response and interpret it.
However, I am currently somewhat stuck on step 1 as it seems rather difficult to record microphone input in Haskell.
Since this is a learning experience I wanted to try to find something simple that I could understand quite easily. After some googling I found this: https://codereview.stackexchange.com/questions/169577/sound-recorder-based-on-sdl2, which uses Haskell SDL2 bindings and Codec.Audio.Wave. I tried copying the code to see if it would work, but alas it did not. I did not have any errors with running the program, but when I tried playing the wave file, nothing happened and it seemed completely empty. Nothing seems to have been recorded, as the file size is only 44 bytes.
I figured the issue was the SDL open device spec not being able to find a suitable recording device, so I tried checking the frequency to see if my microphone wasn't able to handle 48000 Hz and then since that didn't help (it is 96000 Hz max) I tried messing around with the device channels, but that did not help either.
The problem is not with my microphone since I tried recording some audio with arecord (on Arch Linux), which worked just fine. As I said, this is my first Haskell project and I am a bit of a newbie and although I do have experience in other languages it is completely possible that I have done something really silly.
I am not opposed to any solutions not involving SDL2, but as I am looking for something (hopefully) simple and cross-platform, this seemed like a good fit.
So, yesterday, i was calling with my friend and i wanted to play him an sound from a game, but i had no idea how, because he couldn't hear mine sound. So, is there a way to direct all the system audio to record on the microphone? And also keep the normal output so i can hear it. Thanks for help!
And also, please make your answer noob-friendly, because i am pretty bad with this, thanks!
Other stuff:
I want to direct the output into the microphone, not just the calling program (it's Skype by the way).
Please don't answer that i should put the output to the speakers and record it like it, because i don't even have speakers... just headphones.
On a basic embedded systems speaker with a single line of output, wiggling the output as 0 or 1 in a for given periods produces sound.
I'd like to do something similar on a modern Linux desktop. A brief look-see of Portaudio, OpenAL, and ALSA suggests to me that most people do things at a considerable higher level. That's ok, but not what I'm looking for.
(I've never worked with sounds on Linux before, so if a tutorial exists, I'd love to see it).
Actually, it... kinda is. While you can generate the waveform yourself, you still need to use an API to queue it and send it to the audio hardware; there no longer even exists a sane way to twiddle the audio line directly. Plus you get cross-platform compatibility for free.
[...] embedded systems speaker with a single line of output, wiggling the output as 0 or 1 in a for given periods produces sound.
Sounds a lot like the old PC speaker. You might still find code for it in the Linux kernel.
I'd like to do something similar on a modern Linux desktop.
Then you need AFAIK a driver for ALSA. There you can find infos on how to write an ALSA driver. Use PWM to produce the sound.
Since there are many different sound cards and audio interfaces produced by different companies, there is no uniform way to have a low level access to them. With most sound I/O APIs what you need to do is to generate the PCM data and send that to the driver. That's pretty much the lowest level you can go.
But PCM data is very similar to the 0-1 approach you describe. It's just that you have the in-between options too. 0-1 is 1-bit audio. 8-, 16-, 24-bit audio is what you'll find on a modern sound card. There are also 32- and 64-bit float formats. But they're still similar.
I've tried looking up how I might go about this for a while now, and maybe I am using the wrong terminology in my searches or it's way too advanced for me. I basically want to be able to analyze audio files in real-time. I know hardly anything about audio processing so I should probably start small and work my way up. Eventually I'd like to be able to display a power (or frequency?) spectrum correlating to audio playing in real time. Basically like the WinAmp spectogram (terminology?)
Any online tutorials with perhaps an API suggestion or two would be greatly appreciated. I've found some vague explanations (mostly dealing with calculating FFT's then converting them to something...) Like I said, I know little of audio processing, so knowing where to start would be great.
Language of choice: C++
You could look into VST plugins as a starting point for the theory behind audio processing. There's a blog with some tutorials in c++ here.
You can also check out other SO questions on VST plugins for more info.
I believe audacity can run VST plugins, I'll look at that.
EDIT: Audacity doesn't support them out of the box, but you can enable it. You could download a trial of something like ableton live too.
I'd recommend using a graphical tool to begin with to prototype some ideas. Try Puredata or something similar.
http://puredata.info/
Juce is a fantastic way to get to grips with C++ with an Audio slant.
http://www.rawmaterialsoftware.com/juce.php
I've also stumbled across UGen which might help you get up and running without having to understand too much of the sample-by-sample processing theory. I've not looked at this much yet but it looks interesting at the outset.
http://code.google.com/p/ugen/
The KVR forums are full of knowledgable people who will help and direct newcomers to audio and plugin development.
http://www.kvraudio.com/
If you're feeling brave the dive in to a good book. I've heard a lot of good things about the following:
http://www.amazon.com/DAFX-Digital-Udo-246-lzer/dp/0471490784
Good luck! This is not an easy area to get going in!
(PS, the blog linked in the above answer is mine -> it's out of date and wont help you actually do any signal processing)
I want to make a program that takes recorded speech and transforms it so it sounds like it's coming from a Texas TI-99. Do you have any good ideas and resources for how to go about that?
Most of those old speech synthesizers were build directly in-chip. Perhaps you could find a synthesizer that sounds like the chip, but if you really want the original sound, you would either have to simulate the chip (I don't know if it's a simple matter, perhaps the chip internals aren't published).
I only know because I burnt out a number of the Radio Shack speech synthesizer ICs before I managed to get a SP0256-AL2 working.
If you're more of a do-it yourself type guy, you need to find out which IC actually drove the speech synthesis in a TI-99, and then build the chip up on a bread board. That's what I was trying to do back then, and I managed to get the chip to speak, but lost patience after I fried my third chip due to a mis-wiring issue when I attempted to attach it to my PC's parallel port. I think this was the book I was using back then, but there's no cover art featured so it's hard to know for sure.
If you are familiar with how to use ROM images, there seems to be a gentleman that has managed to refeverse engineer the ROM image out of a SP0256-AL2. Look here for the image and the incredible granted permission to do the work and distribute the results.
You could start with open source that does something similar: Adding Robotic/Vocoder effect to your song using Audacity