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
ADVERTISEMENT
May 21, 2013
I am making a level editor that needs to output a custom map file for use with source code that I will write for a graphics library.
My question is: What do I need to bear in mind when deciding how to structure a custom file type? Also how can I encode a standard bitmap image into my file (the tile set) so that it can all be contained in a single file rather two files; the map file and tile set (.bmp file).
View 3 Replies
View Related
May 26, 2014
I was going through tutorial in WPF on customs Cursor, While Running the application i am getting an exception XamlParseException was unhandled, here the code
public partial class MainWindow : Window
{
public MainWindow()
{
[Code].....
View 4 Replies
View Related
Jun 19, 2014
I've been working on a project for a few days now, and within this project I need to have a class system that can function similarly to an if statement. The problem I'm having is I can't seem to find any good information on the order in which if statements process the information within it. I understand that if statements process whatever's in parenthesis first, but my question is that when their are several booleans of equal value, for example: "if(x == 1 && y == 2 || 3 == 4 && 4==6)", in what order does it process these true or false statements? (The actual content of the example is superfluous).
View 2 Replies
View Related
Feb 20, 2013
I need to create a templated doubly linked list, with an iterator class within the list class. This program is to function just like the STL list class but I only need to implement functions that I am using, My trouble is I am kind of clueless on the iterator part and the fact that the list is templated is giving me syntax grief. I have pasted the code I have done so far.
1. On the syntax implementing the list and iterator functions outside of the class
2. I am not sure when to deference the iterator in the functions, but think I have it right so far
3. For the reverse function can I copy the list into a new list in reverse then re add them to the original list overwriting the same values? I have the code I have so far there
4. For the iterator erase function, I am not sure if I am deleting the node correctly.
5. I am not sure if I need template <typename T> above the iterator functions. Does the iterator class need to be a template? Right now it is not.
// Templated doubly linked list class
#include <iostream>
using namespace std;
template <typename T>
class list {
private:
Node *head;
Node *tail;
[Code] ....
View 7 Replies
View Related
Nov 6, 2013
Right now I have code
#include <iostream>
using namespace std;
class Rectangle {
private:
double width;
double length;
[Code] .....
it gives error ...
View 1 Replies
View Related
Mar 6, 2014
I am trying to use std::sort to sort a vector of complex objects using a custom function. However, it keeps erroring "Unresolved overloaded function type".
encounter::encounter(){
// ... cut
std::sort (allpeople.begin(), allpeople.end(), sortByInit);}
bool encounter::sortByInit (character& a, character& b) {
if (a.getinit () == b.getinit ()) {
[Code] ....
View 6 Replies
View Related
Jan 27, 2015
I want to create a C library function that i can directly call in my code from any .c file having main program.following are codes...code of library function "foo.c"
Code:
#include "foo.h"
int foo(int x) /* Function definition */ {
return x + 5;
} header file "foo.h"
Code:
#ifndef FOO_H_ /* Include guard */
#define FOO_H_
int foo(int x); /* An example function declaration */
}
[code]....
to use this i have to compile the file in below manner...
Code: gcc -o my_app main.c foo.c
My concern here is that i want to compile the main.c and use function without compiling foo.c with i.e.
Code: gcc -o my_app main.c
any user of this function should only compile his program and should be able to use the function, the foo.c file should remain hidden from him
my system is Linux 2.6.18-308.4.1.el5 #1 SMP Wed Mar 28 01:54:56 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
View 9 Replies
View Related
Feb 16, 2014
I am currently working on a "bag" class which is sort of a common sense answer to creating a random class with difference functions. I am attempting to create a "union" function which takes two bags ie: bag1 and bag2, adds all the items in both bags and creates a new bag ie: "bag3". For some reason I keep coming up with problems instead of solutions. Maybe it's the fact I just got done with 2 days of calculus. I don't know. My code is below. Both a main(source) and header file.
Header
#ifndef BAG_H
#define BAG_H
const int BAG_CAPACITY = 20;
template <typename T>
class Bag {
private:
int count; // Number of items in the Bag
[code]....
View 1 Replies
View Related
Nov 5, 2013
How to create a diagonal pattern by the given function
void diagonal(int size, char op)
The function takes in 2 arguments, size and op and displays a diagonal line of op char. for example, diagonal (5,#) will produce the following output.
#
#
#
#
#
View 4 Replies
View Related
Aug 13, 2014
I need a function to return a string
I need to pass input as "a,b,c,a,c,d,e"
function should return out put as
"a,b,c,d,e"
View 2 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
May 15, 2013
In the following code:
#include <iostream> // For stream I/O
using namespace std;
int function(int a) {
return a;
}
int main() {
function(int b);
}
Why is creating a variable inside the function argument list not allowed. Any reason other then for the language syntax or just for the language syntax?
View 19 Replies
View Related
Nov 30, 2012
For this problem, you will design and implement 2 classes and then write a driver function to test these classes. The first will be a C++ class for an abstract data type color with a public enumeration type colorType that has the color values shown in Listing 10.8. Your abstract data type should have an attribute for storing a single value of type colortype and member functions for reading (readColor) and writing (writeColor) a color value as well as setting and accessing it. The function readColor should read a color as a string and store the corresponding color value in the value attribute of a type color object. The function writeColor should display as a string the value stored in the value attribute of a type color object (see Figure 7.5). Modify class circle and the driver function in Listing 10.9 to include and use this class. You'll need to remove the declaration for color in class circle. Test your modified driver function with the new color and circle classes.
The second class will be to design and implement a rectangle class similar to class circle. Be sure to incorporate the new color class you have written and tested in the first part of the programming exercise. Write a client program that asks the user to enter a shape name (circle or rectangle) and then asks the user for the necessary data for an object of that class. The program should create the object and display all its attributes.
The circle class .h and .cpp files as well as the original driver function will be supplied. You are to provide the .h and .cpp files for the new color class and the modified driver function as well as the .h and .cpp files for the rectangle class and the client program that uses all three classes.
What I have so far, and I'm pretty lost;
color.h
Code:
Code:
//color.h
//Color class definition
#include "stdafx.h"
#ifndef COLOR_H
#define COLOR_H
class color {
public:
enum colorType {black, blue, green, cyan, red, magenta, brown, lightgray, nocolor};
[code].....
View 4 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
Feb 18, 2014
I am trying to simplify my code by creating a function which takes an input then checks whether it is "y" or "n" then outputs either 1 or 0 depending on the input. So far this is what I have
int Choice(string choice) {
while(choice.compare("n") != 0 && choice.compare("N") != 0 && choice.compare("y") != 0 && choice.compare("Y") != 0){
cout << "Please enter a valid input either [y/n] : " << endl;
cin.clear(); cin.ignore(); cin >> choice;
[Code] ...
And I call it in the program using
cout << "Do you wish to change the hubble type of any galaxies? [y/n]" << endl;
cin >> choice;
while(Choice(choice) == 1){
....
cout << "Do you wish to change the hubble type of another galaxy? [y/n]" << endl;
cin << choice;
}
It compiles fine but displays some bizarre behaviour, I need to end the line twice in order for the program to continue and sometimes it just stops working (doesn't exit just appears to be stuck in a loop).
View 2 Replies
View Related
Apr 9, 2013
I am trying to create a recursive function that i can call on in order to take a user inputed base and exponent and give final answer this is what i have but im completely lost after this i dont even know how to continue. What i have so far
#include <iostream>
using namespace std;
int Exp(int x,int y){
if(base <= 1 || exp == 0) return 1;
if(exp == 1) return base;
int main(){
int number, exp;
[Code] .....
After i set the base situations im not sure how to get the function to make the function take the base to the exponent recursively.
View 3 Replies
View Related
Nov 1, 2014
I was able to get this program running. Now I working on taking one of my member functions and turning it into a standalone function. I choose the create_board() function. Yet, if I declare it in my header file or my main.cpp it cant access any info from the original member functions?
main.cpp
#include "ticTacToe.h"
#include <iostream>
#include <limits>
[Code]....
View 2 Replies
View Related
Nov 30, 2012
I'm am having a few issues with this program, they stem from passing the color.h and .cpp into another .h and .cpp, and frankly getting how those two things really fit together.
For this problem, you will design and implement 2 classes and then write a driver function to test these classes. The first will be a C++ class for an abstract data type color with a public enumeration type colorType that has the color values shown in Listing 10.8. Your abstract data type should have an attribute for storing a single value of type colortype and member functions for reading (readColor) and writing (writeColor) a color value as well as setting and accessing it. The function readColor should read a color as a string and store the corresponding color value in the value attribute of a type color object. The function writeColor should display as a string the value stored in the value attribute of a type color object (see Figure 7.5). Modify class circle and the driver function in Listing 10.9 to include and use this class. You'll need to remove the declaration for color in class circle. Test your modified driver function with the new color and circle classes.
The second class will be to design and implement a rectangle class similar to class circle. Be sure to incorporate the new color class you have written and tested in the first part of the programming exercise. Write a client program that asks the user to enter a shape name (circle or rectangle) and then asks the user for the necessary data for an object of that class. The program should create the object and display all its attributes.
The circle class .h and .cpp files as well as the original driver function will be supplied. You are to provide the .h and .cpp files for the new color class and the modified driver function as well as the .h and .cpp files for the rectangle class and the client program that uses all three classes.
color.h
Code:
//color.h
//Color class definition
#include "stdafx.h"
#ifndef COLOR_H
[Code].....
View 3 Replies
View Related
Jun 24, 2013
This program is incomplete as I am having difficulty creating the function that needs to find the number of perfect scores entered by the user. I have everything but the function complete ,here is my code:
Code:
// Write a modular program that accepts at least 10 integer test scores from the user and stores them in an array.
// The main should display how many perfect scores were entered (i.e., scores of 100), using a value-returning countPerfect function.
// Input validation: Do not accept scores less than 0 or greater than 100.
#include <iostream>
using namespace std;
int countPerfect(int intArray[], int); // Function prototype
[Code] ....
View 14 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
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