listener?
Blitz3D Forums/Blitz3D Programming/listener?
| ||
how can i make it so that the further away u are from something, the less loud it plays a sound? i tried using createlistener on my player, but it didnt affect the sound at all |
| ||
; CreateListener Example ; ---------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,1,-10 light=CreateLight() RotateEntity light,90,0,0 plane=CreatePlane() ground_tex=LoadTexture("media/Chorme-2.bmp") EntityTexture plane,ground_tex cube=CreateCube() cube_tex=LoadTexture("media/b3dlogo.jpg") EntityTexture cube,cube_tex PositionEntity cube,0,1,0 microphone=CreateListener(camera) ; Create listener, make it child of camera sound=Load3DSound("media/ufo.wav") ; Load 3D sound While Not KeyDown(1) If KeyDown(205)=True Then TurnEntity camera,0,-1,0 If KeyDown(203)=True Then TurnEntity camera,0,1,0 If KeyDown(208)=True Then MoveEntity camera,0,0,-0.05 If KeyDown(200)=True Then MoveEntity camera,0,0,0.05 ; If left mouse button hit then emit sound from cube If MouseHit(1) = True Then EmitSound(sound,cube) RenderWorld Text 0,0,"Use cursor keys to move about" Text 0,20,"Press left mouse button to make a sound be emitted from the cube" Flip Wend End |
| ||
again, i tried it. it didnt work w/ emitsound at all |
| ||
in order to have success with use of 3D sound (that means CreateListener command), your sound file, must be MONO..not stereo.. |
| ||
well that is weird... o.o is there another way i can achieve the same thing only w/ a stereo sound? |
| ||
just convert your sound file to a mono and you are all set..use this to do that for free http://audacity.sourceforge.net/download/ |
| ||
It doesnt make sense to work with a stereo sound! The Stereo Sound is already a recorded result of a certain room situation. If you want to get realistic 3D-Sounds, they have to be MONO like in reality. A dog emmits a mono sound! He has only one mouth! With this Mono sounds and the refelctions of eviroment of buildings, moutains, movement, etc... the 3D-Sound-Driver forms a signal better then Stereo. It is more the real sound impression like you would stand in the scene! Using a stereo signal would bring "wrong" 3D-results. |
| ||
If you're thinking that using a mono sound will only play on one speaker, don't worry, the 3D driver determines 'how much' sound plays through each channel according to the emitter position relative to the listener. That's kinda the popint of 3D sound :) |
| ||
i tried mono. still didnt work oO |
| ||
Stick a check in to print an error message if sound is NULL. |
| ||
no. by "didnt work", i am saying it doesnt play the sound very loud w/ emitsound. but when u use playsound its 100% loud. i only want it to be loud if the player is close to the wall, and fires a bullet, or shoots magic. something like that. if the player isnt close to the object the bullet or magic hits, then its not NEAR as loud. |
| ||
its weird.. |
| ||
how can i make it so that the further away u are from something, the less loud it plays a sound? if the player isnt close to the object the bullet or magic hits, then its not NEAR as loud. I really don't know what to say to that.... |
| ||
Where is your listener located? It has to be parented to the player\camera to actually follow the camera around. The listener is the "ears" that pick up the sound. |
| ||
its located on my player |
| ||
Rez, I fear it's you that is 'weird'. You are too lazy to even explain what the problem is... plus what Malice said. wtf? I mean, even if these continual posts are just some kind of a joke, it still makes you a very strange individual. Most people would have got bored by now. |
| ||
John, SHUT UR DAMN MOUTH! IM SICK OF U MAKING FUN OF PPL INSTEAD OF SIMPLY SAYING "O, THAT'S NOT WHAT I NEED TO KNOW!" But NO! U THRIVE on being a jerk! |
| ||
I come up the Blitz3D forums for the sole purpose to read these posts in this voice. |
| ||
Why can't you understand the difference between 'making fun' and a statement of fact? You don't code, you just whinge and moan until someone cracks and writes the code for you. Don't get me wrong, it's pretty clever to piece together a first person shooter when you don't even know what a variable is, but really, what is the point? Why not just get something like this? http://www.clickteam.com/website/usa/ |
| ||
Why not stop being a JERK and LEAVE ME ALONE! O yea. Cuz that would be the RIGHT thing to do. But NO. U THRIVE on being a JERK! |
| ||
The clickteam product doesn't float your boat, then? |
| ||
Here we go again... |
| ||
Why not stop being a JERK and LEAVE ME ALONE! O yea. Cuz that would be the RIGHT thing to do. But NO. U THRIVE on being a JERK! If you would, please tell me something. Here's a hypothetical scenario: In a particular community, a large proportion of people are "jerks" towards you. They don't do this to anyone else, nor do they know you in any shape or form, yet they persist in being "jerks" to you. Which seems most likely to you? 1) These complete strangers have all picked you completely at random to be a "jerk" to. Completely by coincidence they all pick you, and none of them act this way to anyone else. 2) You're doing something wrong. |
| ||
My second thought, if you're sure the listener is parented to your camera, is that the sound source is actually too far away to sound correct. If I remember right, in other programs you were moving things like 3 blitz units per game loop. If your game world is scaled large, something that does not look that far away could actually be like 500 units away, making the sound originate ~500 meters away. Other than that, I have no idea. You're on your own. |
| ||
I think Rez, you need to do some observation - look at other people's threads, and compare them to your own threads - very rarely does the original poster end up cursing people who are trying to give advice, except in your threads. There is no reason any of these people is obligated to give you any advice, help, assistance or even code. |
| ||
Did yo "normalize" the sound in Audacitiy? This is one of the features of the programm. "Normalizing" means optimize the signal in volume. Have also a look on the signal's image in audacity: If there are some extrem "peaks" the sum signal will be very silent, because the peaks define the maximum. In this case it often helps to add some volume, e.g. +5db. Compare the "before" and "after" signal, and add volume upto the point you can hear a "clipping". You can also "see" the clipping". The volume is too high, if many peaks in the signal image reach the upper or lower border of the channel. @john for you it is a joke, for Rez it is a attack. Why cant you stop joking? If people would not like to help Rez, they would not do it. No need for a "watchdog" like you! @Rez Didn't you decide not to react any more on comments like his? Think twice before you aswer. Give him no chance to compromise you! |
| ||
@ Midimaster, because we are genuinely trying to help him out. People won't get ANYWHERE if people code the answers for them. I can't speak for everyone, but i am trying to help (even after he's called me every name under the sun, and insulting me regarding disabled people, even though my father is heavily disabled ¬_¬), not by providing code, but encouraging him to learn the techniques, and doing some simple reading, such as actually reading the command reference. It's mighty frustrating, but i HATE to see people not learning this stuff. Anyways, in blitz3d sounds, i had to generally mess about with the settings to get 3d sound working properly. You just need a bit of trial and error. |
| ||
what settings? i dont see any settings on emitsound.. |
| ||
..im very sure hes pointing on to this settingsCreateListener ( parent[,rolloff_factor#][,doppler_scale#][,distance_scale#] ) what should be interesting for you is >>distance_scale#<< and >>rolloff_factor<< parameters.. |
| ||
i tried that. it still didnt work.... |
| ||
i tried that. it still didnt work.... No problem, maybe 'midimaster' will just code it for you anyway. Just be a little bit patient... |
| ||
SHUT IT, JA2! LEAVE ME ALONE! O_O |
| ||
: ) |
| ||
U LEAVE ME ALONE TOO! U HAVE NO ROOM TO TALK, JERK! |
| ||
..ok..I really dont know what did you check with given example code from begining..i have tried it now and its working just fine, so if you have really tested example code from my first post and its not working, then its 100% your sound file (means not mono)..so, here is my contribution again, and i really hope that you will stop cursing folks around..those are quite nice fellas...here is download link..same code as one from my first post.. http://www.mediafire.com/file/tmmm0mqxjtm/TEST.zip |
| ||
I don't usually comment in threads like this but I have to own up to getting up 5 minutes early in the morning just to login and read the latest posts in Rez's threads. Better entertainment than Coronation Street any of this I can tell ya, with the added benefit of the code posted by those trying to help Rez being of such great quality. Maybe Rez should post all our questions to this forum. I reckon within a week we could have enough quality code to take over the world. Thanks to everyone who still take the time to help him. He might not appreciate it, but I certainly do. |
| ||
u know, its smartasses like most of u (not naming names) who will end up RUINING the human race, because ur too STUPID to take 5 minutes out of ur "o, SO busy" day to help someone. |
| ||
Hiya all, I tested the Code given by NaughtyAlien myself - and its working perfectly fine. I even adapted the Folderstructure inside the games folder to match Alien's code, thanks for that better structure too :D Greetings :) |
| ||
u know, its smartasses like most of u (not naming names) who will end up RUINING the human race, because ur too STUPID to take 5 minutes out of ur "o, SO busy" day to help someone You have learnt nothing in the last 12 months and over 1500 posts. Anytime someone helps you, you show no appreciation whatsoever. ADDitionally, you then go on to call everyone names and use bad language. |
| ||
Like u havent used language urself. u know, ur UNBELIEVABLE. i still cant believe ur even still IN this post. its ppl like u who will bring the earth to the near end. -.- cuz ur too stupid just to QUIT WHILE UR AHEAD! u THRIVE on being a jerk! |
| ||
Like u havent used language urself. u know, ur UNBELIEVABLE. i still cant believe ur even still IN this post. its ppl like u who will bring the earth to the near end. -.- cuz ur too stupid just to QUIT WHILE UR AHEAD! u THRIVE on being a jerk! I don't use bad language online because you never know who will read it. There are many young people that browse the internet and use this forum and it would be inappropriate to carry on with the kind of obscenities that you post when things don't go your way. You know, Rez. I think you are the one that is stupid. Not just because you claim to have 'ADD' but because of the way that you repeatedly ask people to do your programming for you, post that their solution doesn't work, have a falling out, get banned, then start over again expecting different results. Hopefully people will stop posting solutions for you now and make you figure things out for yourself. It is the only way that you will learn, although it seems that you're not even capable of reading through short pieces of text which you are given links to. Did you even bother to download and try Naughty Alien's example that he posted for you? |
| ||
u know what u JERK, im TIRED of u thinking im CLAIMING to have ADD. I have it, and if ur too blind to see that, i think UR the jerk! |
| ||
STOP STICKING YOUR NOSE WHERE IT DOESN'T BELONG! |
| ||
Meanwhile, at the Rover's Return......... |
| ||
John, u have NO room to talk! Ur JUST as much of a jerk as he is! i hope all of u get what u deserve! |
| ||
ADD at it's finest... Rez, you need to learn to relax. Take up a sport, martial arts, anything. Hmmm I'm guessing that you're a single guy. Sounds like you haven't had a bit for awhile, if ever. Find/hire yourself a girlfriend, might help avoid these little tantrums of yours... |
| ||
JA2, SHUT UR DAMN MOUTH AND LEAVE ME ALONE! |
| ||
My mouth isn't open, Rez... |
| ||
LEAVE ME ALONE!!!!!!!!!!!!!!!!!!!!!!!!! AND IT OBVIOUSLY IS OPEN CUZ U KEEP MOUTHING OFF ASSHOLE! |
| ||
ha ha ha |
| ||
FUCK OFF! |
| ||
Rez you really need to stop these noobish posts with "STOP IT!!111!1!1!!" "GO AWAY" "SHUT UP!"... do you really think that's going to stop anyone? |
| ||
You haven't mentioned your coding\sound problem in any of your last 10 posts, only yelled at people. What have you tried? Have you tried converting your sound files? You never answered that question. How far away are your sounds originating from? You never answered that question either. You have no right to talk and swear at any of these people who try to help you. I've had enough of this behavior. Look around, you are the only one being a jerk, yelling, spouting your foul, ill-mannered mouth all over the internet for everyone to read. This is a public forum. Please calm down and stop swearing at everyone. If you don't like what someone says just ignore it and continue with the problem at hand. If you do not shape up, you will not get any help from anyone. Now, can we get back to the sound\listener problem at hand, please. |
| ||
Anybody stop to think what this looks like to newcomers to the forum? No, I thought not. JA2/John Galt - stop goading. Rez - Once again - having ADD (or not, whichever is the case), is no excuse for plastering this site with your toilet language. If you can't control it, don't post. Grow up, and eat some soap. |
| ||
You haven't mentioned your coding\sound problem in any of your last 10 posts, only yelled at people. What have you tried? Have you tried converting your sound files? You never answered that question. How far away are your sounds originating from? You never answered that question either. Clever point there. Sidenote; since this is a question regarding a command (and not it's usage inside a game engine or module), I think it should be placed in Begginers Area. |
| ||
To be honest, "Rez" has this problem on other forums he posts on. So, there is nothing new to him here - this is not unique to this forum. It's just an unfortunate case that he has a disorder (he has certainly mentioned this on other forums) and can get abusively upset. There is certainly a track history of, if people aggravate/annoy him, him getting abusively upset. I predict that this will be an ongoing problem that is not going to be easy to resolve in terms of controlling how people speak to/react to him. |
| ||
I think that the general purpose of a forum is this: one person has a problem. He or she states clearly what the problem is, using keywords in their question. Others then help out. Later on, other people who have a similair problem find this topic with a search engine. They can immediately read the anwers. Once a question has been answered properly, it serves a great deal of people. I've allways concidered the bb.com forums to be a good source of information. However, it is topics like these that clutter up this forum. They serve no purpose at all. It is just a waste of database space. Problems should be more generic than this, and answers should be more suitable. And maybe there should be a limit to the amount of threads a person can open pro week. |
| ||
i tried that. it still didnt work.... You haven't mentioned your coding\sound problem in any of your last 10 posts, only yelled at people. What have you tried? Have you tried converting your sound files? You never answered that question. How far away are your sounds originating from? You never answered that question either. yes a more specific responce helps narrow down what may or may not be the problem is the sound file MONO? its been established that is has to be MONO or it will not work |
| ||
the sound file i dont think is mono, cuz i can barely hear the sound effect |
| ||
Change it to mono using the audio application linked to earlier in this thread. |
| ||
ok |
| ||
..or maybe if you use example i have posted previously, maybe you have to check your sound device volume properities... |
| ||
funny reading back you were told it had to be mono (post 4) and why (post 7) so why you are trying with a sound file that MIGHT be stereo beggars beliefe (windows properties should tell you if it is mono or stereo though) if it is mono then its a different problem edit: anyway testing this with headphones is a must |
| ||
funny reading back you were told it had to be mono (post 4) and why (post 7) Because nobody offered to convert his sound file to mono? so why you are trying with a sound file that MIGHT be stereo beggars beliefe (windows properties should tell you if it is mono or stereo though) |
| ||
Naughty Alien suggested this twice (see posts 4 and 6): in order to have success with use of 3D sound (that means CreateListener command), your sound file, must be MONO..not stereo.. Post 6 even has a link to a program which can convert sounds to mono: just convert your sound file to a mono and you are all set..use this to do that for free http://audacity.sourceforge.net/download/ |
| ||
Don't misunderstand me, I know he was told how to convert the file and Naughty even kindly provided him with a direct link. What I am saying is, that nobody actually offered to do the conversion process for him. |
| ||
John, shut the HELL up! GO THE HELL AWAY! I'm going to CONTINUE persuing u until u go away, so if that is never, so be it. I WILL MAKE UR LIFE A LIVING HELL! |
| ||
Chill out. I'm just pointing out why you assumed your audio file was mono- because it would have entailed a little work on your part to check properly. There are some really generous folk around here. I'm sure you can get someone to do it for you. |
| ||
U did not heed my warning. I WILL MAKE UR LIFE A LIVING HELL! CONGRATULATIONS! |
| ||
I'm sure you intend to... but think of the effort involved. Maybe you can get some kind soul here to do it for you? |
| ||
ITS WORTH IT ASSHOLE! |
| ||
U did not heed my warning. I WILL MAKE UR LIFE A LIVING HELL! CONGRATULATIONS! I'm sure you intend to... but think of the effort involved. Maybe you can get some kind soul here to do it for you? LOL |
| ||
UR IN THIS TOO, PRICK! |
| ||
Awww what you gonna do to us Rez? Throw bad language at us and threaten us with hackers and drowning like you did in previous threads? |
| ||
and this sound file is it genuinly mono or are you still using a stereo file? |
| ||
JA2, SHUT UR MOTHER FUCKING MOUTH U STUPID PRICK! IF U HIJACK ONE MORE TIME IN ANY MY THREADS, IM GOING TO START HIJACKING YOUR THREADS U PRICK! |
| ||
Rez has 'mono'? |
| ||
Hmmm somehow I don't think you'll be having anymore threads to hijack after this one... |
| ||
I WARNED U JERK! |
| ||
and back on planet earth people wonder if the listener program is working or not |
| ||
LOL! LOOK EVERYONE! JA2 MADE A WINNIE THE POOH GAME! XD ROFL!![]() |
| ||
Well now I'm really scared, Rez... |
| ||
well least hes made something ... progress report damit are you still having problems with the listener or havnt you finished having your morning spaz? |
| ||
yes. im still having problems w/ the listener. i tried the ufo sound effect in my game, and it was doing the same thing it was doing with my stereo file |
| ||
LOL! Rez, try converting the sound file to mono.... |
| ||
Oh no! My first finished game that I made 9 years ago! Erm... what's your point exactly? Does it bother that you can't even make simple game without having others code it for you? Or does it upset you that I don't include source code with my games? |
| ||
i tried NA's zip and it was fine for me, although when the cube was at the side of me it only played through one speaker, real life would have had both just not as much in the other ear, it was a bit odd but other than that (and the choice of sound file) no problems for me not knowing how you set it up in your code though i cant comment |
| ||
It's not the sound file thats not working. it's the code. i tried using the ufo sound from the listener example in the game, and it was still acting weird. even though the ufo sound works fine in the example. |
| ||
Define 'weird' |
| ||
Define 'weird' Rez |
| ||
i will post the code later today. im working on it now |
| ||
U can try ALL u want, JA2, im just going to continue ignoring u and letting everybody see how much u try to make fun of others, and ull get whats coming to u. ive had enough of ur sorry ass. u have to make fun of other ppl just to feel good about urself. i feel sorry for u |
| ||
There's nothing to work on. What happens using Naughty's code? |
| ||
naughty's code works fine. and it's not that code im submitting. its the project im using listener in |
| ||
Okay...thread over... we solved the problem!!! |
| ||
Ha ha ha If you're ignoring me then why do you keep replying to me? ADD playing you up? |
| ||
Is there no moderator or admin, that speaks out a warning to both parties? It is a shame for the prestige of the blitzforum to keep those post without consequences! @rez: sorry for you, but you are no longer acceptable! I hoped, that you will be able to abondom your angry aswers to such silly kids. You now loose one of your supporters... but the future of the forum is prior-ranking. @ja2, john and the black-hearted kiddies maybe you think you are well educated, but as you always have the need of writing without saying something related to the theme: you are not better than he is! @admin please do something! Rez's threads take a large amount in this forum with so many "empty" posts. In the german blitz-forum, the posts not related to the question, are immediately deleted by the admin. Always. Of course even this I wrote in this moment! |
| ||
@Midimaster Who put you in charge of the forum? If Rez wasn't so lazy then he wouldn't get bothered by anyone. It's got nothing to do with been 'well educated' or not. Rez simply won't listen to advice or solutions (which even I have given in the past) from the other programmers on these forums. I find his attitude towards everybody, especially towards those who helped him, very distasteful and disrespectful. Rez should have been dealt with a long time ago by one of the admins/moderators. He will probably be temporarily banned again. Wouldn't be surprised if I was also temporarily banned (again) for joining in. It hardly seems fair tho, Rez has some serious issues and his language is UNACCEPTABLE (see I can do all caps, too)... |
| ||
JA2 - maybe you could lay off goading him then you might not get swore at so much? His language is unacceptable - you're right, but let's not beat about the bush, you know exactly what you're trying to achieve here. You're [almost] as bad as each other. Oh, and Midimaster is not pretending to be in charge - he's exercising a little common sense. Maybe you should try it sometime? |
| ||
I'm nowhere near as bad as Rez. Not even close. See any of that language in my posts? See me hurling abuse towards those that have helped me? No, I didn't think so. You can't hold me responsible for Rez's actions/words... I won't post in the other thread that Rez has attempted to derail so I'll post my reply here instead: Rez, why ruin Ross' thread because of an issue you have with me? My email address is in my profile. That's 'support@...' if you're too lazy to find it for yourself. Because you decided to bring my website and games into your ADD induced rants, I've gone and done something rather childish myself... |
| ||
@ja2, john and the black-hearted kiddies Well, I started out genuinely trying to help Rez, and I even had a bit of a go at JA2 for poking fun. Rez's attitude managed to turn me around. I don't understand the relevance of your point regarding my education or lack thereof. I challenge you to find a single instance of me being rude based on someone not understanding the simplest of programming concepts. We all have to learn and I have done my fair share of learning and teaching on here. Laziness and rudeness I consider fair game for a little ribbing, lord have mercy on my black heart. maybe you think you are well educated, but as you always have the need of writing without saying something related to the theme: you are not better than he is! |