C++ :: Playing Selected Music File In Default Player
Dec 15, 2014
How does one go about Playing a music file that they picked and playing it in the default player?
I already have this:
#include <iostream>
#include <windows.h>
using namespace std;
int main(){
string wavfile = "C:Documents and SettingsJasonMy DocumentsJasonMy MusicDummy.wav";
[Code] ....
View 5 Replies
ADVERTISEMENT
Jan 24, 2013
The music that I want to plays not run :( Theoretically all arguments are well, but I don't understand why not works.
if(Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT, 2, 4096) < 0) {
cout << "Error inesperado";
return 0;
}
Mix_Init(0);
Mix_Music *musica = NULL;
musica = Mix_LoadMUS("pixeluniverse.wav");
if (!Mix_PlayMusic(musica, -1)) {
cout << "Error inesperado";
}
...
View 12 Replies
View Related
Mar 26, 2014
I try to play a video I i don't know how.. I searched and i found some tips and articles, but all of it if about Windows Media Player. It's fine, but i need to play something lika an intro an i don't wanna show all that buttons of WMP.. I tried to hide it but no change.
View 2 Replies
View Related
Oct 25, 2013
I am developing a VC++ application with windows media player component. play video from a video buffer data which i have?
View 2 Replies
View Related
Dec 7, 2013
i am working on a wav file and attempting to make it fade in and fade out but i am lost at the momment.. Check my coding below.
Code: #include <stdio.h>
#include <stdlib.h>
#include <string.h>
void main ()
[Code].....
View 1 Replies
View Related
Mar 4, 2013
I want to retrieve the records selected between from_dt and to_dt and also the records of the selected date should be retrieved...
SELECT ChallanDtl.chalID, ChallanDtl.chalTo,
ChallanDtl.chalNo, ChallanDtl.chalDDate,
ChallanDtl.chalYourNo, ChallanDtl.chalPO_NO,
ChallanDtl.chalPO_Date,
ChallanSubDtl.chalsubdescription,
[Code] ...
I am not getting all the records.... when i select the same date in both datetimepicker no record is displayed... i also want the record of the selected dates from both datetime picker..
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
Apr 26, 2013
I can not get the sound to stop playing a cda file with MCI_CLOSE. This code works with wav and mpg and avi files.
LONG WindowProc() {
switch (msg) {
case WM_COMMAND:
if (wParam == IDC_PLAY) {
//A CDA File
SendMessage(m_hwMCI,MCIWNDM_OPENA,0,(LPARAM)&chFile);
[Code] .....
View 1 Replies
View Related
Jun 5, 2014
how to get source path of selected file.
for example :
selected image in E:/
E:ewfolderillustration.jpg
application - asp.net(C#)
View 4 Replies
View Related
Mar 11, 2013
I do not know any of the functions to do this, and when I looked on the internet all the functions I saw were mainly non-standard.
View 12 Replies
View Related
Jan 4, 2014
write a program, pfpq.c, that maintains a priority queue of music tracks (songs) and ratings. The struct is given by:
Code:
struct track
{
char artist[20];
char title[20];
int rating;
};
The program is only designed to demonstrate the concept so get the user to enter a small number of tracks and create a priority queue. (Use an empty string title or an empty string artist to end the program). Print the priority queue as it grows. Your program should initially ask the user if they wish to order the priority queue by rating in ascending order, or by rating in descending order, or if they wish to order the priority queue by artist name. Then build the priority queue accordingly. in the last case, "if they wish to order the priority queue by artist name." which is case 3. How do I sort the priority queue by artist name using in the following code.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pqueue.h"
struct track
{
char artist[20];
char title[20];
int rating;
}
[code]....
View 11 Replies
View Related
Apr 1, 2013
If I don't assign the icon to my executable file (f.e. it's a DOS application), or I have some unknown extension in the file, Windows Explorer assigns the icon to this file.
Is there a way to somehow get this icon? Either from the registry or by any other means.
View 3 Replies
View Related
Apr 28, 2014
I am writing a music program that will read (from a separate file) a guitar chord and display it to the the user. The format of the separate text file is as follows:
A
|--0--|
|--2--|
|--2--|
|--2--|
|--0--|
|--x--|
B
|--2--|
|--4--|
|--4--|
|--4--|
|--2--|
|--x--|
C
|--0--|
|--1--|
|--0--|
|--2--|
|--3--|
|--3--|
etc...
I want the user to be able to search for a specific chord in the file and how I can make that happen.
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
using namespace std;
[Code] .....
View 2 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
Aug 8, 2013
I'm thinking of making a horror text-based game, which would use sounds, if you could also tell me of an API to display images in an alternate window that would be nice.
View 6 Replies
View Related
Apr 9, 2014
I am making a game of quiz and i want to play a small clip in one of the rounds, but i dont know how to do it in c++ ....
View 3 Replies
View Related
Aug 10, 2014
This is a playing card deck creator and shuffler i made yesterday. It is very simple now, but i believe that it could easily be implemented into a card game program of some sort.
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <ctime>
#define STANDARD_DECK 52
[Code] .....
View 1 Replies
View Related
Oct 22, 2014
Write a program to simulate a deck of 52 playing cards.
Represent your deck as a 2D Array where the value in the cell is the position of the card in the deck. Represent the names for the suits and faces as an array of Strings.
Write an algorithm to shuffle the deck.
Display the deck. For Example:
1 Jack of Spades
2 Deuce of Diamonds
3 Three of Diamonds
4 King of Spades
5 Eight of Clubs
6 King of Diamonds
7 Six of Clubs
8 Six of Spades
9 Eight of Hearts
Deal two hands of five cards each. For Example:
****** HAND 1 ******
Jack of Spades
Three of Diamonds
Eight of Clubs
Six of Clubs
Eight of Hearts
...
Below is what I have so far. Dealing two hands and displaying it. How would I be able to do that?
#include <iostream>
#include <ctime>
#include <string>
using namespace std;
void shuffle(int[][2]);
int main()
{
int j,deck[52][2];
[Code]...
View 2 Replies
View Related
Oct 26, 2014
Write a program to simulate a deck of 52 playing cards.
Represent your deck as a 2D Array where the value in the cell is the position of the card in the deck.
Represent the names for the suits and faces as an array of Strings.
#include "stdafx.h"
#include <iostream>
#include <string>
[Code].....
The problem: I am trying to connect the 1d arrays to the 2d arrays. Right now when I write: cout << deck[3][5] << endl; The output answer is 45. How do I populate the 2d array with the 1d arrays so that when I cout deck[3][5] I get it to say "Six of Spades"?
View 8 Replies
View Related
Apr 10, 2014
I'm having some problems with implementing an AI. It should be just a simple AI that follows player. Here is the code that I got so far:
(float)DirectionX = Circle->GetX() - AI->GetX();
(float)DirectionY = Circle->GetY() - AI->GetY();
(float)Hyp = sqrt(DirectionX * DirectionX + DirectionY * DirectionY);
DirectionX /= Hyp;
DirectionY /= Hyp;
x += DirectionX * 3;
y += DirectionY * 3;
This is what I got so far. It creates a vector in a direction I want to move, then just normalizes the vector. Simple as that. But I'm having 2 problems..
AI moves towards player only when Im at like the end of screen and the AI is on the other side, I must keep a certain distance for it to be able to move towards me. Basically, its not constantly moving towards the player. I also tried it with trig, using atan2 for angle and sin / cos for speed. Also didn't work, same result.
The other problem is when I want to add i.e 5 more AIs. For each new AI it creates, it makes a new update.. So, to kinda clear it up. If I'm in middle of the screen and an AI is spawned above me, it will move towards me. But when after that one, 2nd AI spawns beneath me, both 1st and 2nd AI move up. Basically, previous AIs take the update from last one that is created. For updating I'm using lists, objects and iters.
View 3 Replies
View Related
Feb 26, 2015
I'm having some problems figuring out 3 and 4 player games in an Uno game I'm working on. I'm not sure what specifically the problem is, however. I've tried everything I can think of; I'm at a loss for what to do next. Two player games work perfectly, which makes the nonfunctional 3 and 4 player games seem odd to me. Here is the code:
public void MoveOpponents() {
if (nextPlayer == 0) {
if (Main.dir == Direction.Clockwise) nextPlayer = 1;
else nextPlayer = numPlayers - 1;
[Code] .....
The code for the human player is in Update(), but I won't show that because it's actually quite similar to the above code.
Right now what it's doing is jumping all over the place, making opponent 2 play before opponent 1, then I play, then opponent 1 plays. Then I play again. It's really messed up.
View 6 Replies
View Related
Jul 22, 2013
I have programmed a game where you guess a number (1-6) and if the number is equal to the random number then give the player score + 10. But if I have selected for example 4 players then if the game will give player 1 a score it gives player 2 a score instead? What can be causing this error?
Code:
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int cube;
int number[4];
[Code] .....
View 6 Replies
View Related
Nov 29, 2013
I have pseudo code for the minimax algorithm but i was wondering what i would need to add to make it work with many players (n players)?
score minimax(state s, int n)
if (n = 0 OR s is a terminal node) {
if win position for program
return +inf;
if loss position for prg
[Code] ....
View 3 Replies
View Related
Feb 16, 2015
Im using SDL2 but I'm encountering an unexpected error. I have implemented the same method to move as in my old Projects, but the Player appears to be stuck...
The Player is stuck for maybe half a second, and then everything works as it should, but every time I Change direction or i start moving the Player is stuck for a short Moment.
#ifndef _PLAYER_HPP_
#define _PLAYER_HPP_
#include <iostream>
#include <string>
#include "SDLGameObject.hpp"
class CPlayer : public CSDLGameObject
[code]....
View 9 Replies
View Related
Apr 19, 2013
Here is the code I have written so far. My problem is that when the second user enters its position the last user's position is wiped of the board. I want to know how I can hold that position and keep doing so until the game is finished. I thought that calling the previous function would do that (and you can see where I have put that into a comment) but it doesn't.
Code:
#include <iostream> //includes header file
using namespace std;
//function prototypes
void printLeftUpper(int i, int j);
void printMiddleUpper(int i, int j);
[Code] ....
View 1 Replies
View Related
Jan 1, 2015
I actually need to create a labyrinth and a player who needs to go thru the map collecting objects (like bags, water etc...). I planned to do the map with a bidimentional array (5x5) but I dont know how to put different objects on an index.. Ex: array[3][2] will have a Botte of water and an energy bar..
Someone told me to use structs but I dont really understand how this would work... I've tried so many times bit I cant do it...
View 2 Replies
View Related