Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - M squared

Pages: [1] 2
1
Audio / Is it possible to use SoundBufferRecord in a win32 app?
« on: February 24, 2013, 08:32:05 pm »
I'm trying to record in a win32 application. I want the recorder to start when enter is hit, and then stop when enter is hit again. After the recorder starts though, I instantly get an access violation error. I'm thinking this is because the program is leaving the callback function and re-entering to process the enter command while the recorder is recording... I feel like I'm going about this whole thing the wrong way, but I was wondering if there's anyway to solve this without me having to restructure my program.

2
Audio / Re: What format does sfml use to record audio data?
« on: February 22, 2013, 07:21:59 pm »
Ah, thank you much.

3
Audio / What format does sfml use to record audio data?
« on: February 21, 2013, 03:06:10 am »
So I'm using the recording feature in a program where I've previously been doing some work on analyzing the data stored in wave files. Looking at the data I get back from recording using sfml, the data is about 10,000 times bigger. It still looks like it oscillates above and below zero. So is it still basically standard PCM format? Also, the recorded data always starts out with a series of -1's spread throughout a series of zeros. Is this done by sfml or is this something i'm doing? I'm just trying to get a beta idea of how this data compares to how data is stored in a wave file, so any information would be helpful.

4
General / Re: Problem with different dll types
« on: February 20, 2013, 12:17:27 am »
yes but when I did that I got an error saying "openal32.dll not found". I didn't link the dll, i put it in the debug folder. Is that part of my problem? Also, I'm using parts in libsndfile in a way that is independent of sfml. So I'd added the libsndfile dll to my program by itself earlier, and also am using the header file. I don't know if this would affect anything but I thought I should mention it.

Update: I tried creating an new project and copying all my code and such into it and relinking it and that seems to be working. This leads me to wonder if I did something weird to the original project.

5
General / Re: Problem with different dll types
« on: February 19, 2013, 11:26:29 pm »
Thanks, that post was very informative. I'm in debug mode, but I don't see any other version of the openal32.dll file... Also, when I use this file and the libsndfile-1.dll in another program which is also in debug mode, it works fine.

6
General / Re: Problem with different dll types
« on: February 19, 2013, 12:11:22 am »
Errrr.... this is all a little foreign to me. So do I need to find a different dll, change a mode setting, or just not use it?

7
General / Problem with different dll types
« on: February 18, 2013, 08:12:05 pm »
Currently I have a program that uses libsndfile only. I want to also use sfml with this program, but when I try to use objects from the audio library I get an error that I believe is basically telling me i'm using two different types of dlls.

1>sfml-audio-s.lib(SoundRecorder.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>sfml-audio-s.lib(AudioDevice.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>sfml-audio-s.lib(Listener.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>sfml-system-s.lib(Thread.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>sfml-system-s.lib(Sleep.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>sfml-system-s.lib(Platform.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>C:\Users\Menart\Documents\Visual Studio 2010\Projects\Science Fair 2012\Debug\Science Fair 2012.exe : fatal error LNK1319: 6 mismatches detected

The problem is I have no idea what I'm supposed to do about it. I only get this error when using the extlib dll openal32.dll. Is there another version I'm supposed to be using or am I screwing something else up?

8
Graphics / Won't load image
« on: March 10, 2011, 04:43:05 pm »
Quote from: "devlin"
Well - if you're using Visual Studio (or VC++ Express) - you could set the debug working directory to wherever you have the media files (i.e. your picture). (Project settings / Debug... / Working Directory)

You could also add the images to your Debug / Release directory as that would be your working directory by default.

Thanks, it's working.

9
Graphics / Won't load image
« on: March 09, 2011, 07:38:25 pm »
Dang, my typing has gotten pretty bad...
Anywho, your right, my bad. I was thinking about somehting else....
In which case, what directory and or file do you think I should add it to?

10
Graphics / Won't load image
« on: March 09, 2011, 12:51:02 pm »
Quote from: "Relic"
Code: [Select]
if(Image.LoadFromFile("sprite.png"))
      return EXIT_FAILURE;


It should be:

Code: [Select]
if(!Image.LoadFromFile("sprite.png"))
      return EXIT_FAILURE;

Right, I did that, but now it immediantly closes before it even has a chance to draw the sprite. This doesn't happen when I leave out the not operator.

11
Graphics / Won't load image
« on: March 09, 2011, 01:25:28 am »
So i'm using
   sf::Image Image;
   if(Image.LoadFromFile("sprite.png"))
to try to load an image, but I keep getting an error that it can't load the image. I included it in the project file. Heres the code if you need it/
Code: [Select]

// sfml specific headers required
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

int main()
{
//create a sfml window
sf::RenderWindow Game(sf::VideoMode(800, 600, 32), "SFML Blank Window");

//creat the sfml event handler
sf::Event Event;

//Creat a SFML shape
sf::Shape box = sf::Shape::Rectangle(0, 0, 50, 50,sf::Color(127, 0, 100, 255));

//set the box position
box.SetPosition(100, 100);

//creat the image buffer
sf::Image Image;
if(Image.LoadFromFile("sprite.png"))
return EXIT_FAILURE;

// create SFML sprite
sf::Sprite sprite;

//set the sprite image
sprite.SetImage(Image);

// set the sprites posisiton
sprite.SetPosition(400, 400);

// game loop
while(Game.IsOpened())
{
// event handler loop
while(Game.GetEvent(Event))
{
//if x'd out close the game window
if(Event.Type == sf::Event::Closed)
Game.Close();
}
//clear the game window
Game.Clear(sf::Color(100, 149, 237));

// closes game when esc is pressed
if(Game.GetInput().IsKeyDown(sf::Key::Escape))
Game.Close();
// if left mouse and A or D is down move box
if(Game.GetInput().IsMouseButtonDown(sf::Mouse::Left))
{
if(Game.GetInput().IsKeyDown(sf::Key::A))
{
box.Move(-1, 0);
}
else if(Game.GetInput().IsKeyDown(sf::Key::D))
{
box.Move(1, 0);
}
}
//if the right mouse button is pressed and a or d is down move box
else if(Game.GetInput().IsMouseButtonDown(sf::Mouse::Right))
{
if(Game.GetInput().IsKeyDown(sf::Key::A))
{
sprite.Move(-1,0);
}
else if(Game.GetInput().IsKeyDown(sf::Key::D))
{
sprite.Move(1, 0);
}
}

//draw the shape
Game.Draw(box);

// draw the sprite
Game.Draw(sprite);

//display sfml graphics to the game window
Game.Display();
}

return EXIT_SUCCESS;
}

12
General / Event.Type doesn't work
« on: March 06, 2011, 06:51:02 pm »
Quote from: "Laurent"
You don't need SFML_STATIC, this one is specific to SFML 2. But anyway, that doesn't change anything.

I read your link errors again and realized that they have nothing to do with SFML. I don't know why, but somehow your project doesn't link to the default Windows libraries (normally it is always done implicitely by default).

I'm not sure, but I think that adding gdi32.lib, user32.lib and kernel32.lib should solve the problem. If it's not enough, just search the remaining undefined symbols on the MSDN and see in which library they are defined.

That did it!
Thanks, I really appreciate all your time.

13
General / Event.Type doesn't work
« on: March 05, 2011, 10:23:58 pm »
Quote from: "Laurent"
Ok ok.

Sorry for asking you again, but can you tell me which SFML libraries you're linking (in "linker" -> "additional inputs")? And which preprocessor definitions you added (like SFML_STATIC).

in linker
sfml-window-s-d.lib
sfml-system-s-d.lib
sfml-graphics-s-d.lib

for preproccesor
WIN32
SFML_STATIC
_DEBUG
_CONSOLE

the only one I added was SFML_STATIC

Sorry for all the trouble i'm rather new to include file and directories and such.

14
General / Event.Type doesn't work
« on: March 04, 2011, 11:32:20 pm »
Quote from: "Laurent"
So this is not SFML 2.

Well, i though it was.... But it was trunk i got from the svn checkout.

15
General / Event.Type doesn't work
« on: March 04, 2011, 08:34:36 pm »
Quote from: "Laurent"
But which one did you get from the SVN? "trunk" or "branches/sfml2"?

trunk

Pages: [1] 2
anything