C++ :: Radio Station - Streaming Audio On The Web

Jan 22, 2013

work for a radio station as their webmaster, and we have been looking into online streaming options for the last few months for our website. Pretty much everyone charges a monthly fee for this type of service and I feel like it is something I am capable of doing myself.

At the station we have a computer dedicated to operating the music/talk. On this computer there is a program that ques all the music, ads, ect.. This would be my audio source: Either the program playing all the music, or the computer itself.

The problem I have been pondering all night is how would I access this input source? The only audio input I am familiar with accessing is .mp3 or .wav files. How can I code my program to access this audio the program is producing and stream it to people on the web?

View 1 Replies


ADVERTISEMENT

C++ :: System For Managing Radio Station - Crashes When Tries To Dereference The Iterator

Jul 28, 2013

My assignment is to write a system for managing a radio station. The code is composed of four classes:

Song: each song has a name, a composer and a singer, and has a few segments: INTRO,VERSE,CHORUS,TRANSITION, while each represents a different length string of chars.
Playlist: a multiset of songs, and a pointer to a RadioStatistics instance (see below).
RadioStation: a set of Songs (will represent the station database), and a list of Playlists, each playlist holds a few songs from the database.
RadioStatistics: can only be instantiate once, this object gather statistics; it has two maps: one that counts how many times a song was played, and second that counts how many times each singer was played. (the key is the song/singer name, and the value is the counter).

The RadioStation has a constant that defines a limit to how many times a song is allowed to be played. whenever a song reaches this limit (meaning, it was played too much), the program needs to skip to the next song in the database.

so, I run this test from main, and the program crashes (or more accuratly get stuck, since the console stays open and the program keeps working until I stop it).

I made a few changes and run the debugger a few times, and was able to focus on the problem.

Song.h:
Code:
#ifndef SONG_H_
#define SONG_H_
#include<iostream>
#include<string>

[Code] ....

I ran a step by step debugger, and found out the problem lays with line 90 in RadioManager.cpp, when the while loop runs its fourth iteration. It crashes when it tries to dereference the iterator, while it points to the fourth playlist in the list.

And here's some more weird stuff: when I comment out line 73 in main.cpp - it works perfectly fine! (line 73 in particular! commenting out any other line in main.cpp didn't worked around the bug!)

View 13 Replies View Related

C++ :: Simulated Radio Station Holding A Contest - Guess Number / Sequential Search

Dec 14, 2014

I have an assignment to write the code for a simulated radio station holding a contest. The contest is for a "caller" (user input obviously) to guess a number from 1 to 500. The "randomly generated" numbers are already chosen and are being stored in a .txt file. The code is to search for number guessed by the caller and if they are wrong, next caller until a caller is correct. The end result is to display the winning number, the indexed location the number was found, and how many callers guessed. This is what I have...

Code:
#include<iostream>
#include<fstream>
using namespace std;
int sequenSrch(const int prizeArray[], int arrayLength, int searchedItem);
int guess();

[Code] ....

I'm not sure if I am even on the right track... when I pass something into the sequenSrh(); the code compiles, asks for the number to be guessed and ends.

View 2 Replies View Related

C++ :: Create A Small Radio That Allows To Retrieve Audio From URL - External Libraries?

Apr 10, 2014

I've finished my series of tutorials and built a investment calculator with QT, now that's finished and I wanted to create a small radio that allows to retrieve audio from an URL. I wanted to use Juce but I'm clueless about it, I know how to program but I've never touched external libraries?

View 2 Replies View Related

C++ :: Streaming Bytes Into Integer

Sep 4, 2012

I have a FILE stream, and I want to create a function that streams a specified number of bytes (up to four bytes) and returns the value of this, as an integar.

For example, supposing that my FILE has the following data, in hex: 74 C8 02 33 F2 7B....... I then want to stream three bytes and store this as an integar. So, I want to stream "04 08 02". The data stored in the integar should then be "00 74 C8 02", because I have not streamed anything into the first byte. By converting the hex to dec, the integar should then be of the value 7653378 (if it is unsigned).

To try to achieve this, I have written the following function. I create an integar and initialise it to zero, then take each byte from the stream, and OR it with my integar. Then, I shift the integar left by 8, and read the next byte, and so on.

The problem is, when I convert "c" to "c_int", it adds on a load of 1's to the left of the "c" data. This then means that the OR comparison changes all those bits in my integar to 1.

How to solve this? I am also wondering whether there is a much more simple way of doing this, rather than having to write my own function....

Code:
int StreamFileToInt(FILE *fp, int num_bytes) {
char c;
int c_int;
int x = 0x0000;
for (int i = 0; i < num_bytes; i++) {

[Code] ....

View 4 Replies View Related

C++ :: Streaming Input Through Two Constructors (two Classes - Using ADTs)

Jan 7, 2013

I have a main .cpp file which contains int main(int argc, char** argv) and 2 included personal headers which correspond to their linked implementation files.

What I am trying to do is use ifstream to pass integer values from a text file into my program, have the program execute, and then output those modified integers back into the same text file. I have tested the "program" portion of my project using declared values. I know that my program does what I have intended for it to do, but I can't seem to properly inject any outside data using files.

Here's what I have (not including all of the unrelated objective code):

Main.cpp

int main(int argc, char** argv) {
file File;
std::string gameFile = File.findFile(); // prompts user for existing file
if(gameFile.size() > 0) { // load saved game
std::ifstream in;
in.open(gameFile.c_str());

[Code] .....

In game.cpp, I am unsure of Player = new player; and Player = new player(data);. I have never tried doing this. This is simply my best guess of how to make this mess work properly. Hopefully I am close?

Game.h:

#ifndef _GAME_H_
#define _GAME_H_
#include "player.h"
class game {
std::string loadedGame;

[Code] .....

In game.h, I haven't yet tried anything like player* Player;. As stated in my comments above for game.cpp, I have no clue how to go about this.

player.cpp:

#include <iostream>
#include <fstream>
#include <string>
#include <time.h>
#include "player.h"
player::player() {
srand(time(0));

[Code] .....

In player.cpp, I really have no clue where to start with the issue. I'm not even exactly sure if any values are being passed to these variables. Though, I honestly haven't taken much time to problem solve. I don't want to waste a lot of time just to find out that my attempt is incorrect and/or unconventional.

player.h

#ifndef _PLAYER_H_
#define _PLAYER_H_
class player {
public:
player(); // default

[Code] ....

So really, my concerns are: Is my attempt mostly correct? If not, why?

View 1 Replies View Related

C++ :: WHILE Loop Error / In Streaming Data File (with Functions)

Nov 2, 2014

I have a working lab project with a loop error. Code posted in second post. Here's the requirements:

*
- program has to be able to handle file failure
- must loop (prefer to use a while loop here), read in the data, calculates values, etc. and then output the results.

*
The input data file includes

1. a 1 or a 0 indicating that there is a set of employee data following

2. the hourly rate of the employee

3. the humber of hours worked

4. the number of dependents

5. a 1 or a 0 indicating whether the employee is full time (1=full time).

Problem: At first I wouldn't loop back... so I moved the curly brace above the return0;

View 2 Replies View Related

C# :: Sharepoint Radio Button Value

Oct 28, 2014

I am working on a website so you can order online for a restaurant. I currently figured out how to get values of all checkboxes and dropdownlists but i still cannot seem to figure out radio buttons.

Right now i am just making a super string with all of the selected values but eventually i am going to want to make a receipt with a checkout page.

//this seems to work alright
XPathNodeIterator toppingIterator = myNavigator.Select("//my:ToppersGroup", NamespaceManager);
s +=+ "";
while (toppingIterator.MoveNext()) {
XPathNavigator node = toppingIterator.Current;
XPathNodeIterator children = node.SelectChildren(XPathNodeType.All);
while (children.MoveNext())

[Code] .....

View 5 Replies View Related

C# :: Selected Radio Button With Database In It?

Feb 24, 2014

I am developing a project that generates questions from a database, the questions are generated with multiple choice answers. On this form I have got a textbox that reds the question from the database and 4 radio buttons that reads the possible answers from the database. The radio buttons text names are updated with records from a database table each time the "next button" is clicked.

What I want this program to do is that when the user selects one of the radio buttons, I want the system to check if the selected radio button textname equals the right answer in the database table. for example in the table there are 5 columns namely: option1, option2, option3, option4 and rightAnswer. So whenever a user selects a radio button, I would like the system to check if the selected radio button's textname equals the record in the "RightAnswer" column and if so I would a messagebox to show "correct" and if not the messgaebox to show "wrong"

This is the the way I am updating the radio button text names from the database This method is called when the form is loaded

void LoadingPossibleAnswers() {
Query = "SELECT * FROM AnswersTbl";
theReader = conn.ExecuteStatement(Query);
while (theReader.Read()) {
radioButton1.Text = theReader["Option1"].ToString();

[code]....

This method is called when the button is clicked

void CorrectAnswer( RadioButton rdb) {
string correct = rdb.Text;
Query = "SELECT * FROM FROM AnswersTbl;"
theReader = conn.ExecuteStatement(Query);
while (theReader.Read())

[code]....

When ever I run my code above, else condition executes even if the correct radio button is selected.

View 3 Replies View Related

C# :: How To Show MessageBox In 2 Radio Button

Oct 21, 2014

I'm trying to do this :

when user chick first radio button a message1 will show with OK button
when user chick second radio button an another message2 will show with OK button

But its didn't work like this. its work like:

1- user chick first radio button
2- message1 will show with OK button
3- user click OK
4- user chick second radio button
5- message1 will show again with OK button
6- user click OK
7- then message2 will show again with OK button

so when user click in second time its show the 2 message the message1 then the message2

this is my code

private void radioButton2_CheckedChanged(object sender, EventArgs e) {
MessageBox.Show("Amount is ... " + money, "Amount" , MessageBoxButtons.OK , MessageBoxIcon.Information);
}
private void radioButton1_CheckedChanged(object sender, EventArgs e) {
MessageBox.Show("Item name : " + arr[0].name ,
"Availability", MessageBoxButtons.OK, MessageBoxIcon.Information);
}

View 3 Replies View Related

C# :: How To Use List Box Based On Radio Button Selection

Jun 2, 2014

How to put together this assignment. Here is the assignment:

The ABC Shipping Company charges the Rates listed in the following table:

Weight of the package (in kilograms) Shipping rate per mile in California Shipping rate per mile other states

2 kg or less $2.0 $2.5

Over2 kg but not more than 6 kg $3.0 $3.5

Over 6 Kg but not more than 10 kg $3.5 $4.0

Over 10 Kg but not more than 30 Kg $4.0 $4.5

Over 30 kg $5.0 $5.5

Create an application that contains two radio buttons to select California or other states, a listbox for the user to select the package’s weight class, a textbox to enter the distance it is to be shipped, and a button to calculate and display the charges on a label control when it is clicked.

Input validation: Do not accept distances of less than 5 miles or more than 3000 miles

This is what I have so far. I don't know how to set up the listbox option for non california or how to set up a formula.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

[Code] ....

View 3 Replies View Related

C++ :: Program For Calculating Total Price Of Game Station And Game

Sep 13, 2014

I would like to make a program for calculating the total price of a game station, and a game. I made a program like this for just the price of a game in class, but I want to make one that does the game system as well.

View 7 Replies View Related

Visual C++ :: Clicking On Radio Button Crashing Dialog

Mar 3, 2014

I have an existing dialog, having activex control, list control, tree control checkbox, button etc.... I added one radio button and executed the program. whenever i am clicking on the radio button, the dialog hang/crash. Even simply dragging one radio button from toolbox and executing also behaving in the same way.

View 2 Replies View Related

C Sharp :: How To Bind WPF Datagrid Radio-button Column To Entities Class

May 7, 2012

In my WPF application I created a LINQ to SQL entities class. Then I created a partial class and there add code to my entity class. Below is the code of it:

namespace Mynamespace {
    partial class rts_index {
        #region Fields  
        /// <summary>
        /// Status:
        /// "Selected" - true, "Unselected" - false.
        /// </summary>
        private bool _is_selected;

[code]....

Then I executed LINQ to SQL. Works perfectly well. Then I bound WPF Datagrid radiobutton column to is_selected property of the partial class. Below is XAML code:

.
.
.
<Window.Resources>
<CollectionViewSource x:Key="rts_indexViewSource" d:DesignSource="{d:DesignInstance my:rts_index, CreateList=True}" />
</Window.Resources>

[code]....

And here I have the problem. When I'm changing the radiobutton status from Unchecked to Checked it doesn't change the value of is_selected property from false to true in the partial class. I don't know why.

View 1 Replies View Related

C/C++ :: Immediate Audio Playback From Mic?

Sep 25, 2012

I want to develop a soft like Microphone,Other words for that I speak some words for mic, play from earphone immediately!

.h file

#define InBlocks 4 //input buffer numbers
#define OutBlocks 4  //output buffer numbers
#define  INP_BUFFER_SIZE 160  
pWaveHdr1=reinterpret_cast<PWAVEHDR>(malloc(sizeof(WAVEHDR)));
pWaveHdr2=reinterpret_cast<PWAVEHDR>(malloc(sizeof(WAVEHDR)));

[code].....

View 5 Replies View Related

C++ :: Audio Input / Output?

Feb 5, 2015

So I have a project in which I am processing audio signals in real-time. I want to create a class to do this using the ASIO driver. I don't want to use a cross platform library nor do I want to use windows API as it is very slow.

View 2 Replies View Related

C++ :: Playing Audio File?

Jan 5, 2013

i have a audio file that i want to play via C+.

View 4 Replies View Related

C# :: Possible To Send Audio Over Mic Stream?

Mar 10, 2014

I'd like to be able to output sound over skype as if it were coming from my headset, how would I go about this?

View 1 Replies View Related

C# :: Audio Visualization For RGB STRIP

Apr 7, 2015

I have a RGB STRIP connected to Arduino, when im communicating via Serial. All works great! So next i wanted to make some audio visualisation.. So i found some samples etc.. and then i created the Audio Visualisation via C# using BASS.NET, when R has been BASSes, G medium frequency and B high frequency. But isnt looking good, so i started thinking, what 3 variables in song has can use, but this is bad idea.. I got idea to change to random color when its get "beat" or BASS hit some value. I tryied 4 hours of doing it, searching, programming... But i cant do it...

So, my question is how to detect the beat or just anything event for Audio Visualisation. Best output form WASAPI. Only what i can do is get FFT and Audio Spectrum from WASAPI by BASS.NET, but thats all. My audio skills is so low for this.

View 4 Replies View Related

C/C++ :: Audio Playing With Irrklang?

Apr 4, 2014

I tried playing audio using irrKlang in openGL.But i ended up with some problems.

I have attach my source file and also my output file here.

View 2 Replies View Related

C :: Creating Custom Audio Function

Apr 2, 2013

I'm trying to make a windows-focused , I will make it portable after , audio function that plays sounds according to my midi file. I know there is playsound, but it's not what I desire. I'm curious if Beep plays through the sound card or is similar to printf("a") ? I'm just looking for a low level solution.

View 1 Replies View Related

C :: Opening Audio File Using Language

Sep 6, 2013

how to open an audio file using c. write a code to open an audio file.

View 2 Replies View Related

C++ :: Giving Audio Input To A Program

Sep 27, 2013

I want to give audio-input to a FFT code (KissFFT) written in C, on a real-time basis. While I can give a simple test signal (like sine wave) by writing the sine function as input, I am not sure how I should convert an audio-signal (e.g.: song) into a form that can be taken as input by the KissFFT C code.

View 3 Replies View Related

C++ :: How To Start Coding Audio Synthesizers

Mar 20, 2013

I'm interested in learning how to write the software for audio synthesizers. a friend of mine started on the hardware side for them and, as i have no experience with this type of code.

View 7 Replies View Related

C++ :: WaveinOpen - How To Choose Audio Channel

Feb 12, 2015

I'm using waveinOpen to capture sound from my microphone. I know how to set how many channels to use, but how do you tell it what channel to use - left or right?

View 6 Replies View Related

C++ :: Pulse Output Through The Audio Jack?

Dec 12, 2014

know of a code snippet that will send a pulse to either the left or right channel of the audio jack and stop the pulse when desired?

Platform is windows 7 or 8.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved