|
I tried to do an "overlap/switch" with the buffers, but it didn't work. I can't get the playback of the 2nd wave to start where the 1st wav left off (i.e. I can't connect them in playback without a blip). I'm sort of stuck...I might try to do it via streaming, but I don't know if that'll work (i.e. using only 1 buffer that plays/loops continuously with periodic writes to the beginning of the buffer to replace old data (until only the loop part is remaining).
|
|
|
|
|
This is precisely what I was talking about. In order to achieve smooth transition from one wave to another, use one secondary buffer in STREAMING mode. Put it to play back in looping mode, then showel in appropriate sound data from either the 1st wave, the 2nd, or the 3rd, depending on what you need.
The catch is to use some wave editor program to place markers or some other method to obtain precise moments in the sample files on where the looping section begins.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I haven't worked with audio for a while, but a "blip" when you loop is a natural hazard!
Even if you loop a complete WAV file, you will get a blip if the start and end do not have (1) the same value, (2) the same slope (i.e. the same rate of change of value), (3) the same rate of change of slope, etc.
Looping where start and end points have different values gives you a step in the waveform, which is heard as a click. Looping where the start and end levels are the same but there is a significant change in the slope of the waveform gives a similar, but less noticeable effect.
I forget the theoretical background - look at the Fourier transforms for a step function!
How much you hear a loop also depends on the grade of your sound card - a cheap card with poor frequency response may suppress the high frequency transient, making it less noticeable. But then again, it may not filter out high frequencies well, making the blip more noticeable.
Getting a smooth loop is an art (I never got this right - I hired a studio musician!)
Good luck.
|
|
|
|
|
winsock2 for MS Visual C++ Toolkit 2003
Do we need to find winsock2.h elsewhere?
Alternatively where do we access the following files please?
include sys/socket.h
include netinet/in.h
include arpa/inet.h
include unist.h
Can anybody help me please?
After downloading MS Visual C++ Toolkit 2003
My obective is to experiment with client server communications & eventually communicate over a network.
Do we need to find #include winsock2.h elsewhere?
and for example copy winsock2.h into the include directory of C:\Program Files\Microsoft Visual C++ Toolkit 2003\include.
I tried to compile the code in "IPv6-Enabled Client Code" in
MSDN Home>MSDN Library>Networking and Directory Services>Network Protocols>Windows Sockets 2>Using Winsock>IPv6 Guide for Windows Sockets Applications>Appendix B: IP-version Agnostic Source Code.
After selecting and copying the "IPv6-Enabled Client Code"
I pasted the resulting code into "notepad" and called and saved the new file as client.c.
I tried compiling the client.c using
C:\Program Files\Microsoft Visual C++ Toolkit 2003>cl /Tp client.c
The response was
Microsoft (R)32-bit C/C++ Optimization Compiler Version 13.10.3052 for 80x86
Copyright (C)Microsoft Corporation 1984-2002. All rights reserved
client.c
client.c(14) : fatal error C1083 : cannot open include file : 'winsock2.h' : No such file or directory
This ERROR REPORT has been changed
The previous reported error was incorrect because I forgot to remove a winsock2.h file from the include directory. I apologise this winsock2.h file DID NOT originate with the Microsoft Visual C++ Toolkit 2003 download or from Microsoft.
Yours sincerely,
George.
P.S. Alternatively where do we access the following files please?
include sys/socket.h
include netinet/in.h
include arpa/inet.h
include unist.h
|
|
|
|
|
include sys/socket.h
include netinet/in.h
include arpa/inet.h
include unist.h
I believe those are Unix style network header files and they don't exist in the Windows SDK.
Winsock2.h should be part of the Windows Platform SDK which is available for download or I beleive is installed as a default with Visual Studio 2003 C++
Can someone tell me what this reference to Visual C++ "Toolkit" is that people keep refering to?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hi Pete,
Thank you for the advice.
I downloaded Microsoft Visual C++ Toolkit 2003
from
http://msdn.microsoft.com/visualc/vctoolkit2003
George Kermeen
george@dudley-designs.co.uk
george@kermeeng.fsnet.co.uk
|
|
|
|
|
I made a win32 dll and did these two things which BTW work for another dll I had made but maybe I have forgotten some step because this one gives: (also the earlier one took hours and hours before I got it to compile but it does now)
split.cpp(93) : error C2375: 'Split' : redefinition; different linkage
split.h(17) : see declaration of 'Split'
The lines in question are:
in the cpp file
#define DllExport __declspec( dllexport )
extern "C"
{
DllExport int __cdecl
Split (InputArgs inputArgs)
{
etc...
}
}
in the h file:
extern "C" int _cdecl Split (InputArgs inputArgs);
As far as I recall these are the only two things I had done in my other dll that works....but obviously I have forgotten something that makes that one work.
Any ideas appreciated.
thanks
sb
|
|
|
|
|
You need to add __declspec(dllexport) to Split() 's prototype in the header file.
Jeremy Falcon
|
|
|
|
|
I just built a simple database using CFormView. When I was completing the wizard I clicked for the form to start up minimized. After completing my project, I found myself wishing I had chosen to have it start maximized. How can I change this after I've finished? I'm new at this so take pity if it's just a simple change I need to make. Thanks!
Garry
|
|
|
|
|
Look in the InitInstance() method.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thank you, I checked InitInstance() and even InitApplication() and can't find anything that would possibly correct this. Any other thoughts? I really appreciate your guidence.
Thanks
Garry
|
|
|
|
|
I created an app that minimizes when it opens and this is what I found.
BOOL CMyApp::InitInstance()
{
...
...
...
if (!ProcessShellCommand(cmdInfo))
return FALSE;
m_pMainWnd->ShowWindow(SW_SHOWMINIMIZED);
m_pMainWnd->UpdateWindow();
return TRUE;
}
Change or add m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED); to the above code.
|
|
|
|
|
Did you overlook the m_pMainWnd->ShowWindow(SW_SHOWMINIMIZED) statement in the InitInstance() method?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Below is my initInstance Function. There is no :"m_pMainWnd->ShowWindow(SW_SHOWMINIMIZED)". Is there another place it could possibly be? Thank you for your patience!
Garry
BOOL CCustomerApp::InitInstance()
{
// InitCommonControls() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
InitCommonControls();
CWinApp::InitInstance();
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(4); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(IDR_CustomerTYPE,
RUNTIME_CLASS(CCustomerDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CCustomerView));
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// call DragAcceptFiles only if there's a suffix
// In an MDI app, this should occur immediately after setting m_pMainWnd
// Enable drag/drop open
m_pMainWnd->DragAcceptFiles();
// Enable DDE Execute open
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line. Will return FALSE if
// app was launched with /RegServer, /Register, /Unregserver or /Unregister.
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The main window has been initialized, so show and update it
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
|
|
|
|
|
Was this created with Visual Studio 6? Have you looked at the project's frame-related classes to see if they are adjusting the window's size? Since it is an MDI application, have you looked at the CChildFrame::ActivateFrame() method?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes, I did check them. this program is being compiled in VS.Net. Is .Net different enough from 6.0 that there would be something else to consider?
Garry
|
|
|
|
|
Zenix2 wrote:
Is .Net different enough from 6.0 that there would be something else to consider?
Since I do not use .NET, I cannot say.
You might want to create three projects, A and B and C, with one being initially minimized, one being initially maximized, and one being the default settings. Then compare the files to see where the difference is.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Good thought, thank you! It makes sense. I appreciate all your time.
Garry
|
|
|
|
|
Anyone can explain me what is the concept of data class. How it is different then the normal class.
|
|
|
|
|
I've never heard the term "data class" before but it sounds like it might be a struct .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Hi All
I like to put my MFC MDI application into a dll. There will not be any supporting exes. Needs to bring the UI through some function call from dll.
I appreciate if anybody can help me with this.
|
|
|
|
|
Have you ever written a DLL in C++?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hi!
How can I create an owner draw progress bar in Win32 SDK(no MFC)?
|
|
|
|
|
Check the articles on this site. I believe there are one or two on this topic.
__________________________________________
a two cent stamp short of going postal.
|
|
|
|