mixing

Audio Mixing with Java (without Mixer API)

筅森魡賤 提交于 2019-12-05 02:49:19
问题 I am attempting to mix several different audio streams and trying to get them to play at the same time instead of one-at-a-time. The code below plays them one-at-a-time and I cannot figure out a solution that does not use the Java Mixer API. Unfortunately, my audio card does not support synchronization using the Mixer API and I am forced to figure out a way to do it through code. Please advise. /////CODE IS BELOW//// class MixerProgram { public static AudioFormat monoFormat; private

Mixing Microsoft MVC ajax and validation helpers with native jquery ajax

落花浮王杯 提交于 2019-12-04 13:45:58
Introduction This post is about mixing Microsoft MVC helpers with native jquery ajax. The main problems i encountered along the way were: Double post submissions @Html.ValidationMessageFor not outputting attributes Requirements I have a requirement to validate and post a form (id = "my-form") The form is bound to a model decorated with validation attributes so I want to make use of helper methods such as @Html.ValidationMessageFor to harness unobtrusive benefits I need both client side and server side validation (server side i do a unique name check with the database) I need to do some client

How to mix PCM audio sources (Java)?

半世苍凉 提交于 2019-12-04 10:24:26
Here's what I'm working with right now: for (int i = 0, numSamples = soundBytes.length / 2; i < numSamples; i += 2) { // Get the samples. int sample1 = ((soundBytes[i] & 0xFF) << 8) | (soundBytes[i + 1] & 0xFF); // Automatically converts to unsigned int 0...65535 int sample2 = ((outputBytes[i] & 0xFF) << 8) | (outputBytes[i + 1] & 0xFF); // Automatically converts to unsigned int 0...65535 // Normalize for simplicity. float normalizedSample1 = sample1 / 65535.0f; float normalizedSample2 = sample2 / 65535.0f; float normalizedMixedSample = 0.0f; // Apply the algorithm. if (normalizedSample1 < 0

how to convert C# to C++ [closed]

▼魔方 西西 提交于 2019-12-04 02:08:12
Closed . This question needs to be more focused. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed 11 months ago . Could someone please help me to convert C# to C++? here is an example: using System; using System.Net; using System.Text; using System.IO; using System.Threading; namespace read_website { class Program { static void Main(string[] args) { while (true) { DownloadString("http://www.xxx.asp"); Thread.Sleep(100);//update every 100 millisecoand } } public static void

Audio Mixing with Java (without Mixer API)

痴心易碎 提交于 2019-12-03 17:18:02
I am attempting to mix several different audio streams and trying to get them to play at the same time instead of one-at-a-time. The code below plays them one-at-a-time and I cannot figure out a solution that does not use the Java Mixer API. Unfortunately, my audio card does not support synchronization using the Mixer API and I am forced to figure out a way to do it through code. Please advise. /////CODE IS BELOW//// class MixerProgram { public static AudioFormat monoFormat; private JFileChooser fileChooser = new JFileChooser(); private static File[] files; private int trackCount; private

Mixing 16 bit linear PCM streams and avoiding clipping/overflow

断了今生、忘了曾经 提交于 2019-12-03 04:36:20
问题 I've trying to mix together 2 16bit linear PCM audio streams and I can't seem to overcome the noise issues. I think they are coming from overflow when mixing samples together. I have following function ... short int mix_sample(short int sample1, short int sample2) { return #mixing_algorithm#; } ... and here's what I have tried as #mixing_algorithm# sample1/2 + sample2/2 2*(sample1 + sample2) - 2*(sample1*sample2) - 65535 (sample1 + sample2) - sample1*sample2 (sample1 + sample2) - sample1

iPhone: Mix two audio files programmatically?

人走茶凉 提交于 2019-12-03 02:08:32
I want to have two audio files and mix and play it programmatically. When I am playing the first audio file, after some time(dynamic time) I need to add the second small audio file with the first audio file when somewhere middle of the first audio file is playing, then finally I need to save as one audio file on the device. It should play the audio file with the mixer audio I included the second one. I have gone through many forums, but couldn't get the clue exactly how to achieve this? Could someone please clarify my below doubts? In this case, what audio file/format I should use? Can I use

Mixing 16 bit linear PCM streams and avoiding clipping/overflow

廉价感情. 提交于 2019-12-02 18:53:48
I've trying to mix together 2 16bit linear PCM audio streams and I can't seem to overcome the noise issues. I think they are coming from overflow when mixing samples together. I have following function ... short int mix_sample(short int sample1, short int sample2) { return #mixing_algorithm#; } ... and here's what I have tried as #mixing_algorithm# sample1/2 + sample2/2 2*(sample1 + sample2) - 2*(sample1*sample2) - 65535 (sample1 + sample2) - sample1*sample2 (sample1 + sample2) - sample1*sample2 - 65535 (sample1 + sample2) - ((sample1*sample2) >> 0x10) // same as divide by 65535 Some of them

fortran pass character*81 array to c/c++ code

孤者浪人 提交于 2019-12-02 16:09:23
问题 I am a fresh in programming, I wanna to call a fortran function in my c++ code. the thing is I dont know how to pass a fortran character*81 array to my c++. fortran code is like: subroutine func01(a) implicit none character*81 a(2) write(*,*) a(1) write(*,*) a(2) end c++ code is like: #include <iostream> extern "C"{ void func01_( const char **a ); } int main() { const char *a[2]; a[0]="Hello world!"; a[1]="This is a test!"; func01_(a); return 0; } I bascially tested my fortran code using this

fortran pass character*81 array to c/c++ code

独自空忆成欢 提交于 2019-12-02 07:30:23
I am a fresh in programming, I wanna to call a fortran function in my c++ code. the thing is I dont know how to pass a fortran character*81 array to my c++. fortran code is like: subroutine func01(a) implicit none character*81 a(2) write(*,*) a(1) write(*,*) a(2) end c++ code is like: #include <iostream> extern "C"{ void func01_( const char **a ); } int main() { const char *a[2]; a[0]="Hello world!"; a[1]="This is a test!"; func01_(a); return 0; } I bascially tested my fortran code using this program pro01 character*81 a(2) a(1)='Hello world!' a(2)='This is a test!' call func01(a) end program