I'm doing a mixer with wave files. I can play and even apply the reverse effect to them. the logarithm is like this:
for( unsigned int i=0; i<sampleCount/2; i++ )
{
// swapping with the other half
double temp = samples[i];
samples[i] = samples[sampleCount-i-1];
samples[sampleCount-i-1] = temp;
}
Now I want to apply these effects to the files: delay, slow, and fast but I don't know how to do it. The teacher told me that to do it slow I need to double the Samples so I tried to do this samples[i] = samples[sampleCount*2]; it does not work......Also I apply the contrary to do make the sound fast samples[i] = samples[sampleCount/2]; the samething I don't get the sound desired.
For the daley part I'm thinking on play the audio one without touch it and then repit it 8 times or more to create the delay.... I did it like this:
I need to create a sinewave. I have the values in an Excel file. The code reads the excel file and prints the values in the cmd but I need it to print back into excel as a sine wave. Pretty sure its currently values for a triangle wave but whatever I want a wave before I care about the type.
Description: Creates an array of values of a triangle wave, prints the result to the screen and creates a CSV (comma separated variable) file of data points. Allows user to enter number of amplitude and number of cycles
#include <stdio.h> #include <stdlib.h> #include <conio.h> #define N_SAMPLES 1000 // crashes if array size > 1000? #define UP 1 #define DOWN 0
I'm new in c programming and my requirement is as follows. I make a code for oss mixer and now when new systems, throwing the OSS, and there is no /dev/mixer I want to port my code to alsa but my skills are minimal.
Code: static int mixer_fd = -1, mixer_src = -1; static char *devices[] = SOUND_DEVICE_NAMES; int mixer_init(char *mixer_device, char *mixer_source) { int i;
mixer_src = -1; for (i=0;i<SOUND_MIXER_NRDEVICES;i++) if (strcmp(mixer_source, devices[i]) == 0)
[Code] ....
Coexistance with OSS would be nice, so both could be used depending on users choice. Perhaps: if this first part of the mixer name is a valid device file, try OSS, otherwise try ALSA?
Should I change the inner loop (checking active channels and if they're valid) to the outer loop?
So the outer loop checks if the channel is valid for use, The inner loop checks and increases the current relsample The inner loop adds the sample to the mixer.
When the outer loop finishes: The outer loop clips all samples.
Would this be faster than the current method? (so instead of a: for (sample=0;sample<4096;sample++){for (channel=0;channel<66;channel++){/* Process channel here */}}
We get: for (channel=0;channel<66;channel++){for (sample=0;sample<4096;sample++){/* Process sample */}})
Code: 90 y | | | +-180 -------------------- 0 x | | | -90
I want to calculate a new x,y such that it follows a sine wave like pattern until it gets to point (0,0). I want the width of the arc to go out to about -45 degrees, and the same on the other side to about -135 degrees.
How can I compute these new x,y coordinates in C++?
I am currently working on an arcade game for my final assignment this year. I am struggling to get a sine wave movement with the saucer. Here is the code for it:
It should cut wav files into smaller pieces using text file .lab (the values multiplied by * 0.0000001 gives time in second. For example, i have such file with recorded yes and no: [URL] ..... and such boundaries [URL] .... It all should be in the same folder, then, after puting "yesno.wav" into command line and press enter it should gives 2 files with yes and no words. But it doesnt - i obtained one file with silent and one short sound. The record is recorded by Audacity, default sample rate 44100, default sample format 16-bit.
I have built the wave tool and now am trying to run my source code through it. But it just doesn't want to find the include directory. I just don't understand. Here's my command:
Perhaps it how I built it since there is no info on how to do this? I just ran ../b2.exe from the boost_1_53_0/tools directory.
I'm running CYGWIN_NT-6.1-WOW64 TARDIS 1.7.18(0.263/5/3) 2013-04-19 10:39 i686 Cygwin with a g++ version of 4.5.3. g++ has no problem finding the default include directory (I don't have to specify the -I switch). The -I switch doesn't seem to work for any of the other include directories that I wan to use either, but I want this cleared up before I get into that since it might be related.
I am writing a program to hide files behind other files using Alternate Data Streams in Windows NTFS file systems.
The program is as follows:
Code:
#include <stdio.h> #include <stdlib.h> int main(void){ char hostfile[75], hiddenfile[75], hiddenFileName[15] ; printf("Enter the name(with extension) and path of the file whose behind you want to hide another file: "); scanf("%75s", hostfile);
[Code]...
The complier is showing error as "Extra Perimeter in call to system" but I am not getting where?
I am writing a piece of code that requires me to display the last 1000 lines from a multiple text files (log files). FYI, I am running on Linux and using g++.
I have a log file from which - if it contains more than 1000 lines, I need to display the last 1000 lines. However, the log file could get rotated. So, in case where the current log file contains less than 1000 lines, I have to go to older log file and display the remaining. For e.g., if log got rotated and new log file contains 20 lines, I have to display the 980 lines from old log file + 20 from current log files.
What is the best way to do this? Even an outline algorithm will work.
How do I read a .pdf file using C++? When I try to open it using myfile.open ("example.pdf"); but all I see is some Crazy Symbols. Is there any way to open ?
Assignment: Write a program that merges the numbers in two files and writes all the numbers into a third file. your program takes input from two different files and writes it output to a third file. Each input file contains a list of numbers of type int in sorted order from the smallest to largest. after the program is run, the output file will contain all the numbers in the two input files in one longer list in sorted order from smallest to largest. your program should define a function that is called with the two input - file streams and the out - put file stream as three arguments.
Okay, here is my code.
#include<iostream> #include<fstream> using namespace std;
int main() { int list1[25];//array for the first list int list2[25];//array for the second list
[Code] .....
I'm confused about where the two files (which contain lists of numbers) need to be placed in order to be read and if they need to be renamed or something.
So I am awful when having to use data or .txt files. I believe my code is right, I just don't know how to upload the files. Here is the description of the assignment and the coding:
Process the input file containing latitude and longitude data of US cities in degree, minutes, and seconds. Output the processed information in decimal degrees.
a) Write a C++ program to read each line of the input file, store each data line in an array of structure, calculate the degrees in decimal for latitude and longitude, store these values in the corresponding structure and write the results to the output file by processing the array.
b) Use vectors or dynamic array to optimize memory usage. Specify the design choice in your main comment for the program.
c) Split the City and State and store it in two separate fields.
d) Search a city and find it in the array of structure and print out ALL the information on the screen.
#include <fstream> #include <iostream> #include <iomanip> #include <vector> #include <string> #include <algorithm> using namespace std; struct City
I'm using maps and writing files for the first time and I get a crazy compiler error when I try to compile the following code.
//map is named schedules // saveSchedule() is a member of the Schedule class that writes a vector of objects to disk, or is supposed to ofstream newFile("sched.txt"); map<string,Schedule>::iterator in;
I have a program below that calculates the average, sum, etc of the numbers in a file named "mynumberlist1.txt".
I want to create a loop whereby the program loops through several files; mynumberlist2.txt, mynumberlist3.txt, and calculates the statistics for all relevant files using the calculations below. How would I do this?
I have to develop a program that will analyse these time-sampled voltage and current measurements over 24 hours and find the total energy used, mean and peak power consumption and Energy used over each hour of the 24 hour period.
How do I go about doing this? I also need to include at least one numerical integration technique. The file data contains over 50 thousand lines in the format mentioned above.
I am trying to learn about parallel arrays and files. I believe that I wrote a program that properly writes the data of the arrays into a file, but I am not quite sure how to take the next step and make a second program by bringing in the file I created and reading the information of the file back into two arrays to display them.
I would like to make a program that automatically launches and loads a file when a file of that file type is double clicked within windows. As said I am unsure where to look for some information as to how to do that, and so turn to you all. Is there a simple way of doing such a thing without using any external libraries, if so, a simple tutorial or link to a reference for this; if there is no way of doing this without externals what would be a small and simple to use library for this?
I have created a project in netbeans 7.2 and have not modified any setting. I have used all sorts of methods I could think/find but the code can not find the file.
I have placed my test.txt file in the folder of the project. Here is the location of the file:
C:UsersSAMARASDocumentsNetBeansProjects eadFi le
However, I could not use it without modifying it as an absolute path.
For example, check the code from the FAQ. //well the return 0; is missing but this is not the problem now.
Or for example this code Code: bad code or with Code: myReadFile.open("C:/Users/SAMARAS/Documents/NetBeansProjects eadFile est.txt"); I have tried many things for placing the slashes, but could not find the file.
I'm writing a program to merge all .txt files in a directory. I had the code working and then made small change. It started crashing and I couldn't get it back to working.
If I comment that section out, the code still works. But, I know that portion of the code works to copy text from one file to another! It's actually from the Schildt complete C reference and I have tested it several times on it's own.
My first time programming sth in Network. I have to use C to send a file to another PC, well COM port are useful but I didn't find how to refer to the address of my destination.