C :: Can Play Audio Without Extra Window Showing?
Jul 7, 2013
I got this code from a wiki that taught me how to make C code that plays audio, and with a few changes I was able to get it to take a command-line argument as the music file name. Here it is
Code:
#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>
#include <SDL/SDL_mixer.h>
int main(int argc, char *argv[])
[Code] ....
The only problem is, even though I guess it needs to create a window to work with SDL, is there any way you could hide it or something so the user can't see it? I don't really want to see it ( I'm planning on running it from Batch files or C applications as an easy way to play an audio file once ), because if I did, I might as well just use a default audio player instead.
View 3 Replies
ADVERTISEMENT
Jun 6, 2013
I need to make a program which can play a audio file as background while executing other operations .
View 4 Replies
View Related
Jul 21, 2014
How do I play a simple mp3 through my mic. I plan on using this to just play annoying sounds through skype and games(on windows 7 btw).
View 6 Replies
View Related
Mar 6, 2014
I understand how to play a .wav file in a program, but I am attempting to "package" the .wav file with the project so that it can be played by another person, on a different machine (namely, my professor). The way I have come to understand this is that if you use the following line of code:
PlaySound(TEXT("C:WindowsMedia
otify.wav"), NULL, SND_FILENAME);
The sound file would not play if it is not in the same location on the other computer. Am I correct? Assuming that I am, I have added the file that I wish to play as a resource in my project, but I can't figure out how to make it play. Looking at MSDN (and other resources) I found the following snippet:
#define MAKEINTRESOURCE
PlaySound(
MAKEINTRESOURCE(L"notify.wav"),
GetModuleHandle(NULL),
SND_RESOURCE);
I get no errors when I build the program, but no sound plays when I run it. I have tried for hours now to figure this out (which is usually enough time for me to sort through the problem) but I have met with no success. This leads me to believe I am either completely off in my assumptions, or I am making a silly mistake.
View 6 Replies
View Related
Feb 2, 2015
Suppose you want to develop a program to play lottery. The program randomly generates a Lottery of a three-digit number( any number from 100 to 999), prompts the user to enter a three-digit number, and determines whether the user wins according to the following rule:
1. If the user matches the lottery in exact order , the awards is $100,000.
2. If the user input matches the lottery digits, the awards is $50,000.
3. If two digit in the user input matches a digit in the lottery, the awards is $30,000.
4. If one digit in the user input matches a digit in the lottery,
the awards is $10,000.
Sample:
The winning number is 865.
Your ticket is 865 then 100000
Your tickect is 686, or 568,.. all digits are right but not in order
You get 50000
Your ticket is 860, or 186 .. then 30000
Your ticket is 800, 706, 600.. just one digit much you get
10000
Else
0
Im using if/else statements. Which syntax would I use to figure out the limit between 100-99?
View 1 Replies
View Related
Nov 16, 2014
I have a Blackjack game that allows users to create a login account and it keeps track of their bet amount, and total bank,etc. How can I connect the program on 2 or more computers so that people can play together?
(A) How would I code it? (B) Can I just connect a USB or HDMI and use the appropriate code? (C) Do they need to be executables instead of just running out of Visual Studio? (D) Can this maybe done over Wi-fi? (E) Or is this something more complicated like over a VPN?
View 2 Replies
View Related
Jul 16, 2013
How can I play sound when the program ends? I am using Windows 7.
View 15 Replies
View Related
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
Dec 14, 2014
"Write a program to play a numbers guessing game. The user thinks of a number between 1 and 100 and your program asks questions to figure out what the number is (e.g., "Is the number you are thinking of less than 50?"). Your program should be able to identify the number after asking no more than seven questions. Hint: Use < and <= opeartors and the if-else construct."
What I've managed so far, but what I have seems to be lacking
Code:
#include "../../std_lib_facilities.h"
int half(int guess);
int going_up(int i);
int main()
[Code] ....
View 4 Replies
View Related
Jul 2, 2014
How can i play a mp3 file in the background?How can i rule the volume of the mp3 file?why does delay(0.25) doesnt work in this code?
Code:
FILE *datei;
char line[ANZAHL][LAENGE];
int i ;
datei = fopen ("song.txt", "r");
if (datei != NULL){
for(i = 0; i < ANZAHL;i++) {
delay(0.25);
fgets(line,LAENGE,datei);
printf ("%s
[code]....
View 2 Replies
View Related
May 25, 2014
How to reset the board in order to play again without spots already taken.
#include <iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
char location[10] = {'0','1','2','3','4','5','6','7','8','9'};
int displayMenu(int &player, int &win);
[Code] .....
View 1 Replies
View Related
Nov 5, 2013
I have designed a vc++ dll for a controller. I want to add usb plug and play feature inside the dll. I searched on line and came to know:
"If the project is an unmanaged C++ DLL project, then I can only create windows in an unmanaged way, i.e. the usual Win32 API way, such as adding a new dialog box as a resource, or simply using RegisterClassEx() and CreateWindowEx() to create the window yourself, then pump messages for those windows using GetMessage(), TranslateMessage() and DispatchMessage()."
how to use this concept.
I have created a separate application (in delphi 2007) that load this Dll. But I want to add this Plug and Play feature inside me dll.
View 11 Replies
View Related
Mar 26, 2014
I am just at the starting point of this subject. How do i add a video player to my windows form application in vc++?
Can I link youtube videos to that player to be played?
View 2 Replies
View Related
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
Jan 5, 2013
i have a audio file that i want to play via C+.
View 4 Replies
View Related
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
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
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
Apr 1, 2014
So , i had to make an rock paper scissors game . After lot of hard work and struggle ,I completed it but my professor rejected it since I didnot add option where it says "Would you like to play again .Y/N " . The code has too many brackets ! Here is my code
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
// for displaying the outputs to the user; passing string to functions
void user_win() {
[Code] ....
View 1 Replies
View Related
Jun 5, 2013
i want to create a program (in c++ or c#) that will play mp3 files but also display a word file with the lyrics of the mp3 song playing. so if i choose a mp3 file from a list, the lyric file for that song should also be displayed. i have all the mp3 and lyric files saved on the computer so my problem is how can i link the files?
View 5 Replies
View Related
Sep 11, 2013
OK, so the program is working minus the play again loop. I even tried a goto statement for it but no luck. Basically what its doing is after the game runs its course it asks if you would like to play again? If you hit Y it starts over but if you it N it starts over. I want it to out put thank you for playing and close after user hits a button.
// C// Guess My Number
// The classic number guessing game
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
[Code] ....
View 1 Replies
View Related
Jun 24, 2014
I'm trying to create a program that will play scales at certain frequencies, but my arrays are not initializing correctly. I've read up to double check what i'm doing but it doesn't seem to be working. My only guess is my use of a global variable.
const int NotesInScale = 8;
class Scales {
private:
//all Major Scales
int CMajor[NotesInScale];
int GMajor[NotesInScale];
[Code] ....
i'm simply trying to put the frequencies in the scales (the numbers in the array) but I keep getting an error. I feel its a simple fix but i'm not seeing it.
View 8 Replies
View Related
Sep 15, 2012
I'm making an apllication which needs to play .wav file when user type something inside QTextEdit. I made some code but after minute or less the sound stops, so I made silly workarround. After 30 clicks I invoke sound->stop(); and then the loop start again, that works, but it's not good, can you give better solution. Here is my code:
Code:
int count = 0;
bool MainWindow::eventFilter(QObject *o, QEvent *e){
if(e->type() == QEvent::KeyPress)
{
tipka->play();
tipka->seek(0);
[Code]...
View 1 Replies
View Related
May 17, 2013
Saw a thread about a program to add an extra 'b' before 'B' in a file containing 'ABC'. I tried it. Here's my code:
("file1.txt" contains "ABC")
#include<iostream>
#include<fstream>
using namespace std;
int main(){
ifstream in;
ofstream out;
[Code] ...
It works except an extra C appears at the end.
O/P in the file:
"AbBCC"
View 4 Replies
View Related
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
Sep 6, 2013
how to open an audio file using c. write a code to open an audio file.
View 2 Replies
View Related