|
Hi,
I need a client which can communicate with the server using websocket+ssl or socket.io+SSL. I have searched in Google,but i got websocket client and ssl client individually.can any body help me please...
Thanks,
vvk.
|
|
|
|
|
Member 10881745 wrote: can any body help me please With what? You need to show what you have done to create this, and exactly what problems you are having. If Google does not find the sample that fits your requirements then you probably need to write one for yourself.
|
|
|
|
|
I am looking for c++ code that can load a .wav audio file and output a .csv text file. Then convert it back again. That is wav-to-csv and csv-to-wav. This is an unusual conversion process so any help is welcome.
|
|
|
|
|
.wav is a binary file and .csv is a text file.
So what is the conversion that you would like to do?
You cannot normally convert audio data to text data and vice versa.
So you need to be more specific on your question.
The only conversion that I can think of is to extract the tag information from a .wav file to a .csv file.
But then again the reverse would not be possible because there is no audio data in a .csv file.
The next thing that you can do is a simple rename of the extension from .wav to .csv, but that doesn't make any sense either.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
The WAV file format is relatively simple to parse. You may have a look at the specifications (as starting point, you may check out its Wikipedia page[^]. Once you are able to parse it you have to decide how to generate a meaningful (for instance an 'easy for the human to read') format for putting all the information in the CSV file.
Veni, vidi, vici.
|
|
|
|
|
Here is the only code I can find for writing a .Wav file. This is python which I know nothing about. I have .csv files of data that when plotted draw a mandala. I want to save the same file to a .wav format so I can play the mandala as sound. Is writing a wav file possible with C++ code or do I need a library?
https://gist.github.com/Pretz/1773870
#!/usr/bin/python
import wave
import numpy
import struct
import sys
import csv
from scikits.samplerate import resample
def write_wav(data, filename, framerate, amplitude):
wavfile = wave.open(filename, "w")
nchannels = 1
sampwidth = 2
framerate = framerate
nframes = len(data)
comptype = "NONE"
compname = "not compressed"
wavfile.setparams((nchannels,
sampwidth,
framerate,
nframes,
comptype,
compname))
print("Please be patient whilst the file is written")
frames = []
for s in data:
mul = int(s * amplitude)
# print "s: %f mul: %d" % (s, mul)
frames.append(struct.pack('h', mul))
# frames = (struct.pack('h', int(s*self.amp)) for s in sine_list)
frames = ''.join(frames)
for x in xrange(0, 7200):
wavfile.writeframes(frames)
wavfile.close()
print("%s written" %(filename))
if __name__ == "__main__":
if len(sys.argv) <= 1:
print "You must supply a filename to generate"
exit(-1)
for fname in sys.argv[1:]:
data = []
for time, value in csv.reader(open(fname, 'U'), delimiter=','):
try:
data.append(float(value))
except ValueError:
pass # Just skip it
print "Generating wave file from %d samples" % (len(data),)
arr = numpy.array(data)
# Normalize data
arr /= numpy.max(numpy.abs(data))
filename_head, extension = fname.rsplit(".", 1)
# Resample normalized data to 44.1 kHz
target_samplerate = 44100
sampled = resample(arr, target_samplerate/100000.0, 'sinc_best')
write_wav(sampled, filename_head + ".wav", 100000, 32700)
|
|
|
|
|
You know, this piece of code does use a libraries (import wave, etc..). With C++ you can either use a library or write the calsses and methods (for instance setparams ) yourself.
Veni, vidi, vici.
|
|
|
|
|
Other response suggests you want to go from csv to wav.
Steps
1. Determine for all given values in csv how them map to a 'sound'. There are any number of ways to do this. As one example you might pick a small audible music scale and then discretely break up the entire range of csv numbers along this scale. This step does NOT involve code.
2. Write code to parse the csv
3. Find or write code that outputs a wav file
4. Write code that takes the csv data, maps it via what you determined in 1, and then using 3 write it.
|
|
|
|
|
Hi All,
My application has a browser plugin. It is an ActiveX component and inside this component, it has UI. There is a user defined message and its handler. Handler invokes a function which in turn displays a modal dialog box.
While the modal dialog box is opened, the user defined message handler is being invoked. In the code, they are using SendMessage & PostMessage with this user defined message. I don't see any SendMessage call in the function which is responsible for displaying this modal dialog box.
Now my doubt is, how is is possible to invoke user defined message handler with out using SendMessage while modal dialog box is opened?
Is there any difference in the behavior of PostMessage while running inside a browser?
|
|
|
|
|
Can i set the scroll bar position (X, Y) of window. by clicking on the menu??
if yes please let me know as soon as possible. plz help me....
|
|
|
|
|
|
I'm running an MFC apps in Visual 2012 for Genetic Algorithm Timetable.
c:\users\zahrina\documents\visual studio 2012\projects\gaschedule\gaschedule\gaschedule.h(6): fatal error C1189: #error : "include 'stdafx.h' before including this file for PCH"
main.cpp
c:\users\zahrina\documents\visual studio 2012\projects\gaschedule\gaschedule\gaschedule.h(6): fatal error C1189: #error : "include 'stdafx.h' before including this file for PCH"
GaScheduleDoc.cpp
c:\users\zahrina\documents\visual studio 2012\projects\gaschedule\gaschedule\gaschedule.h(6): fatal error C1189: #error : "include 'stdafx.h' before including this file for PCH"
GaSchedule.cpp
c:\users\zahrina\documents\visual studio 2012\projects\gaschedule\gaschedule\gaschedule.h(6): fatal error C1189: #error : "include 'stdafx.h' before including this file for PCH"
CourseClass.cpp
Here is the coding for gaschedule.h
#pragma once
#ifndef __AFXWIN_H__
#error "include 'stdafx.h' before including this file for PCH"
#endif
#include "resource.h"
class CGaScheduleApp : public CWinApp
{
public:
CGaScheduleApp();
public:
virtual BOOL InitInstance();
public:
afx_msg void OnAppAbout();
DECLARE_MESSAGE_MAP()
};
extern CGaScheduleApp theApp;
|
|
|
|
|
When using precompiled headers, you must include the file stdafx.h on top of all source files (*.cpp) before including other header files.
When not using precompiled headers, comment or remove the __AFXWIN_H__ condition lines in the gaschedule.h file.
Precompiled headers can be configured in the C/C++ section of your project settings.
|
|
|
|
|
thank you very much. it helps me.
|
|
|
|
|
Hi,
I need to convert the JSON file into XML file using C++ code.
Can anyone help me in this regard?
Thanks & Regards,
SAM
|
|
|
|
|
Help you with what? You need to explain what you have tried and what does not work, but don't expect someone else to write your program for you.
|
|
|
|
|
Hi Richard,
I need some link to start it from scratch..Atleast it will give me some basic idea about this. I am new to JSON..
Thanks,
SMA
|
|
|
|
|
I guess the difficult part is parsing the JSON format (writing XML , on comparison is easier) so any library/component able to parse JSON would do the trick.
Veni, vidi, vici.
|
|
|
|
|
libjson[^] looks interesting.
Veni, vidi, vici.
|
|
|
|
|
I am going through an older programming book which uses both C and Assembly. Most of these assembly routines are 16bit routines. How do I get Visual studio to link in my .obj files.
The first part of the book uses .asm files with a corrisponding .c file, where the c program uses the function in the .asm file.
As I scan through the book it looks like it uses inline assembly in the later parts of the book.
I have both MASM 6.11 and MASM32 and I have access to Visual Studio 6, 2005, and 2010.
These all are 32bit compilers, where the samples in the book all seem to be 16bit and I think they expect to run under DOS, not windows.
Is it possible to create these sample programs and test them?
I do have access to a machine that has Windows XP on it, if that would help?
Thanks!
|
|
|
|
|
(my 2c)
Get a new modern game programming book.
Unless you come around a REAL performance issue (measured and profiled), there is no need nowadays to use assembly code.
good modern C and C++ coding practice will be sufficient to do everything you need to do in a game.
As for the question, I don't have a clue; I've not touched assembly code in 20+ years of professional work.
I'd rather be phishing!
|
|
|
|
|
|
Actually I selected this book specifically because it was a mix of 16bit assembly and C. I have a project coming up that was written as a C and Assemby application. This gaming book looked like a fun way to pickup on the skills I need.
I have not done any C and Assembly mixed programming, before, so my biggest problem right now is to figure out how to successfully build a complete runable app.
I am not really planning to write a game, I just want to be able to get the samples to work as I read through the sections I need.
Thanks again!
|
|
|
|
|
Member 10875481 wrote: This gaming book looked like a fun way to pickup on the skills I need. On the contrary it is an extremely bad way. Learning how to write 16-bit applications is a total waste of time since Windows no longer supports them. Get hold of a modern book on C++ or C#, and a copy of the latest Visual Studio*, and spend your time learning the languages that will be of some real use.
* If you cannot afford to buy the pro version then you can get the Express Edition[^] which is free.
|
|
|
|
|
Hello All,
I wanted to implement a 'Wizard' based property sheet. Below is by plan.
1. In the first page, I will have three option (Option 1, 2 and 3)
2. If user selects 'Option 1' and clicks 'Next', I have to load Page 1. If user selects 'Option 2' and clicks 'Next' I have to load Page 2. If user selects 'Option 3' and clicks 'Next', I have to load page 3.
3. If user comes 'back' and changes the 'option' selection on run time, the page loading should be changed accordingly.
Is it possible to implement using MFC?
If yes, any help would be really appreciable.
Warm Regards,
Sankaran
|
|
|
|