Audio streaming using C++ tutorial and sample code [closed] - c++

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I would like to learn basics of audio streaming. In particular, I would like to learn how to capture audio from a computer mic, and in real time stream it so that another user can listen to it live. I would like to do it on Windows.
Is there any good tutorial that explains how it is done and some sample C++ code that I can take a look for more details?
Also I heard ASIO provides a low latency library, so I am interested in that.

Maybe here would be a good place to start, if you're using Windows?
Have a read of that page and look at the WASAPI as well.
You can capture raw audio directly from the device using the IAudioCaptureClient
I have been involved in projects involving real time streaming of audio and have used aac as the audio format and Live555 for a streaming library. These might be a good place to start.

For recording and playing audio on Windows I would recommend the waveform audio API. You have an example here for recording data from the mic.
For the streaming part, if you want to use an already available multimedia streaming server, i would recommend icecast, with its API lib.
If you want to implement the network streaming by yourself, then you can use the asio lib. You have some examples here.
For audio playback on the client side, there is a tutorial using waveform API here.

Related

Communicate With Online Message Board [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
How might one create an application that communicates to an online website's message board, say www.espn.com's message boards that can retrieve posts, post stuff, and flag posts. How might somebody go about creating an application that does something like that? sockets?
I would like to create this in c++
This is actually more complicated than it sounds. Most message boards don't open up their API (usually to prevent spam), and if they do, you'll probably have to work with them to get the details.
The general idea is:
Open socket to their server
Send the appropriate data according to their API
Profit
If you want to hack it, you'll have to do some scraping/wireshark packet sniffing to figure out their API. There will probably be some cookies you'll have to read to get communication tokens and whatnot. It's possible, but it's a lot of work.
Some other websites (like Twitter and Google) open up their API and actually provide developer tools to interact with their data. I don't think a site like ESPN would be that open to hobbyist developers, so you'd probably have to sign some kind of agreement.
If you're really interested, read up on HTTP (here's a really simple beginning tutorial). Most APIs are built on the HTTP protocol, so you'll want to become very familiar with it. I'd recommend using something besides C++ though, since socket work can be a bit tedious. Try something like Python.

Sending data securely in C++? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Can someone give me some guidance on my problem - I am writing a game (CryEngine) and I need to know how to send data - including usernames and passwords to a server where they can be stored in a database and shown on a webpage displaying the players "stats". I'd like to start with the usernames and passwords as they are the most paramount that I get right, the other stuff really doesnt have to be encrypted. Although, it might make it a bit harder for hackers to alter their stats.
So how would I approach doing this? I know my way around C++ and I have been using it for a while, I have already built a system that stores and captures the player's kills and XP etc. but this bit sounds more tricky. It sounds like I'm going to make heavy use of BOOST and possibly OpenSSL, but having never used these libraries before or having to make a secure system, I'm slightly confused. Any help or general directions are greatly appreciated!
Open SSL sounds solid, have a look here: http://www.ibm.com/developerworks/linux/library/l-openssl/index.html .
You can use almost every crypting library for this (better not writing your own stuff) but since it is client/server anyway, using a protocol/system that was designed to do exactly this, your best bet is openSSL.
The rest is a secured server with some sort of application running on it (Java EE) and handling the entries in some sort of database.
Then choose some web-language of your preference to retrieve database entries.
PS: dont do it live (eg. every headshot is an entry) but transmit the final results of a round, or once every X minutes.
I suggest using HTTPS.
Link against libcurl and with a few cookbook examples from the net you can have your client portion ready in a couple of minutes or hours. Fiddling with OpenSSL by hand could take days or weeks if you are new to it.
For the server part you can use your game's existing web server. Your game is going to have a web site, isn't it? The users will be able to access their stats via their web browsers too.
If you want to protect the score update mechanism, use regular cryptography API like crypt and a key hidden in the code to obfuscate/deobfuscate the player's score update password. It's obfuscation, not encryption, since the key ultimately resides on the client machine and can be recovered with a debugger.

Image anlaysis in C/C++ [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I'm rather novice in C++ and I must realize this schoolar project :
Assume an image in a document containing both texts and images.
There should be a program written in C++ whose the goal is to load the document and extract separately texts and images in order to output it in
some target destinations like UI or file.
Furthermore, if image contains any texts like legends, program should be able to extract it separately too.
Is there an existing c++ library that respond to those requirements ?
Yes, OpenCV.
http://sourceforge.net/projects/opencvlibrary/
No doubt in that, use OpenCV.
But remember, you have a long way to go.
1. First of all, you should be good in C++ and object oriented programming.
Well, if you are not good, try to learn it first. Check out following link for some best resources : https://stackoverflow.com/questions/909323/what-are-good-online-resources-or-tutorials-to-learn-c
2. Then get OpenCV and install
Check out OpenCV homepage to get info about downloading and installing OpenCV.
3. Now get and read some good books on OpenCV
The best book on OpenCV is "Learning OpenCV" written by Gary Bradsky, main founder of OpenCV.
Second one is "OpenCV cookbook".
These books contains lots of examples on OpenCV along with description
4. Check out OpenCV documentation.
OpenCV documentation contains details of complete functions. It also includes a lot of tutorials, which are really good for all.
5. Also try running OpenCV samples. It contains a lot of good programs
And always, Google is your best friend. Ask everything there first. Come here only when you are lost in your path.
Acquire all the above things. Then you will be really good in OpenCV and i am sure you will enjoy its power. Once you are done with these, you will get enough idea on realizing your project.( Otherwise, you will post new questions every day asking codes to realize your project, which will be useless for you. )
For your understanding, your project include advanced things like Optical Character Recognition. It is a big topic. So build yourself from basics. And it will take time.
All the best.

Editing bitmaps in C++ [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I am wondering if there is any good tutorial or a book on loading,creating and editing bitmaps in c++. I need to edit bitmap pixel by pixel but none of the tutorials don't show how. I want to understand how does bitmap "work" and wikipedia helped a little.
If you want to manipulate bitmaps on the pixel level, then you should start learning Image Processing and then read something about bitmap file formats. It is not a C++ question. C++ is just icing on the cake in such task.
Here you can find some lectures on Image processing:
http://www.archive.org/details/Lectures_on_Image_Processing
And here is the description of BMP file format:
http://www.fileformat.info/format/bmp/spec/e27073c25463436f8a64fa789c886d9c/view.htm
You can easily find a lot of sources for other formats as well. Good luck, I have been studying this topic three years at the university... I think you really should use some open source library as David Grayson advised.
If you want to edit a bitmap you only need to learn about the format you want to edit. How many bits per component, how many components per pixel, where is the width and height defined, what's the standard for said format files. If you want to use the popular BMP you can find all this in Wikipedia.
If all this made little sense to you, then you should try a tutorial on digital image processing first.
An image is just an array of structures (pixels) with a certain number of components each, you just need to read and write said array to do whatever edition you want. But be warned, although common crops and pixel replacement are almost trivial, advanced edition and altering are not.
I'm assuming you searched Google already and didn't find anything good.
If I were you, I would learn about the binary format of bitmaps first. You can learn about it by reading the specifications and/or looking at bitmap files with a hex editor like WinHex or ghex2.
Then I would learn how to read files and work with binary data in C++.
But really you could probably save a lot of effort if you just used the Magick++ library:
http://www.imagemagick.org/Magick++/

How to write C++ audio processing applications? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm an Electronics and Telecommunications student, next to my graduation. I'm gonna work on a project that involves my knowledge about DSP, music and audio in general. I allready know all the basic mathematic instruments and all the stuff I need to manage it, such as FFT, circular convolution ecc ecc.
I want to learn C++ programming basically for one reason: it's very important in the professional world!!! And I think it's one of the most used to write applications working with audio, especially when it's about real time processing.
Ok, after this small introduction I would like to know first, which are the most used libraries to work with audio processing in c++?? I was longer looking on the web but i couldn't find a lo of working stuff. (I work under linux with eclipse CDT enviroment).
Then I would like to know if there are good sources to learn how to write some working code, such as for example how to write a simple low pass filter. Basically now i will not write real time applications, I would like to start from the processing of a WAV file, or even better an MP3 file, so basically on vectors of samples.
Let's say that basically for now I would like to extract the waveform from an audio file, and save it to a thumbnail or to a PNG image.
Ok, for now I think it's all I would need.
Any ideas, advices, libraries, books, interesting sources about that?
Thanks a lot in advance for any kind of answer.
Giovanni.
I would suggest for you to write your own WAVE file reader and writer in C++, without relying on external libraries. The WAVE format is fairly straight forward, at least if you only intend on supporting the most common wave files.
Then you'll have access to the audio data, which you can easily manipulate in C++. I would recommend starting by modifying the volume, the number of channels to calculating statistics on the audio. Creating a PNG of the audio waveform requires some more advanced C++ skills...
Checkout this link which will give you some information on the available (commercial and open source) audio editing softwares.
Some interesting open source audio editing tools which are written in c++,
Audacity
LMMS
Qtractor
Ardour
Rosegarden
C++ library for audio processing.
SndObj
The Synthesis ToolKit in C++
C++ Code and links related Filters and audio processing..
C++ code for Filter,Audio Processing
Code Guru,Low pass filter
I've used BASS with good results (there's a C/C++ API you can use).