Create a car sound with frequencies [closed] - c#

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I'm trying to create a car game in C#. I'm now trying to figure out a way to get some sounds into the game. For example, the acceleration sound of the car.
I recently tried to add a 5 second-sound of a real car accelerating, but I don't think its the right way to do it. Because then i have to start from the beginning all the time of the clip when i accelerate.
Is there maybe some way to work with frequencies? To send a frequency to the speakers and then just increase it when I accelerate (And to make it sound like a car)
I've heard about PWM, could that be something?

One way to approach this might be to mix some sounds together...
For example, if you had a series of sounds such as:
Car Idling
Car accelerating from 1st to 2nd, gear, etc
Sound of the car downshifting / engine braking
Sound of the car in each gear
You could just play different sounds at different times and cross-fade between them. Perhaps you could even do some pitch adjustment during playback to correspond to the throttle.
I'm not sure how the pros do it (Grand Theft Auto, Grand Turismo), but that's the first thing that comes to mind.

When I need audio in my C# projects I always try to use NAudio.
NAudio Algorithm to play a sinewave whose frequency can be changed smoothly in real time (there's a link to an algorithm the author wrote in the body of the question)
http://mark-dot-net.blogspot.com/2009/10/playback-of-sine-wave-in-naudio.html

Related

Allocation Formula [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have car repair services shop, there are many services(Diagnosis, Engine Repair. Electrical repairs...) Sequence conservation does not matter
And then I know how much time does one current car needs for single services, for example:
Ford - 120 minutes for diagnosis, 360 for engine and 80 for electric repairs
BMW - 90 minutes for diagnosis, 480 for engine and 140 for electric repairs
Mercedes - 90 minutes for diagnosis, 42 for engine and 160 for electric repairs
Etc. And there is big list of cars.
So is there any good algorithm or mathematical formula which allocates cars optimally into service boxes such don't waste time of boxes and get best result with minimal waiting of cars.
This is an example of a so-called "Open-Shop" problem. The difference to Job Shop Scheduling is that in the latter the sequence in which jobs are executed on machines is relevant, while this is not the case in your example.
Unfortunately, the problem is NP hard for your case. (For two machines is could be solved in polynomial time.) No need to despair, as there are a number of algorithms that will probably work just fine for your problem size.
Wikipedia has a few good starting points under "Open-Shop Scheduling", with a reference to a classical paper in this area.
Your problem is called the "Job-Shop Scheduling" problem or sometimes just "Shop-Scheduling." It is widely discussed because it becomes extremely difficult as the number of variables increase (it is what is called an "NP-Hard" problem).
There is no easy answer, but there are several good algorithms to pursue that trade accuracy for calculation time. I suggest the book "Approximation Algorithms for NP-Hard Problems" edited by Dorit Hochbaum as a resource.

Voxel Terrain in C# [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm looking to create a simple voxel engine in C#. I know a lot of XNA but heard it would be better to do it in OpenGL / DirectX. Anybody know how I would accomplish such a thing? I do not want a library as I want to learn how to do it from scratch.
OpenGL and Direct3D are both "triangle" APIs - they aren't volumetric renderers. We need more information about what you want your voxel engine to do.
If you want to render voxels directly, then your best bet is to avoid OpenGL and Direct3D and write your own OpenCL or CUDA renderer (or even be 100% software on the CPU).
Rendering voxels to OpenGL or Direct3D would require converting the voxel world to triangles - using something like marching cubes. This technique can be efficient if the voxel world is fairly static and the voxels are large (like Minecraft). However this technique wouldn't work in massively-deformable worlds, for example, as you'd have to re-generate the triangle scene on a regular basis, which will be expensive.

Best way to capture handwriting and turn it into typed text [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I would like to write a program which captures motion using a Kinect and then saves the path of motion and then converts the image created into text.
I am not sure if OCR will be the best way to do it as in all probability the quality of the image will be quite low.
Is there some system anyone could suggest. Also any tips on how to achieve it. Cheers
edit:
Windows Journal does pretty much exactly what I want.
You need a sensor like Kinect and use its APIs to capture the motion. This is very specific to the sensor and motion capturing technology. I don't think you can write a motion capturing technology without third party API using C#.
I fail to see the advantage that the Kinect can give you here.
You have to define first what kind of input this system will have: Will it be the RGB image of a character for example or something more complicated like tracked hand position through time?
If you want to use the Kinect for its depth map, then what you are trying to do seems more like gesture recognition (and mapping of each gesture to a character) to me rather than OCR.
Edit for the gesture recognition way:
I haven't implemented anything myself on that, so I can not really give you clear directions or proposals. There exist a couple of papers on the subject (google scholar search) that take advantage of the available depth info rather than working with 2D images. I would guess that the DIY way would be to get as many training samples as possible for each gesture, train your classifier (wikipedia on supervised learning) and then test your new samples.
If you don't feel so adventurous, you could start by testing some code samples that exist:
The hand tracking sample from OpenNI -you can see an example here, I think it recognizes some gestures too- .
Candescent NUI "Hand and finger tracking with Kinect depth data", I don't think it includes any recognition, but maybe it can help you get better data.
The Kinect for Windows Developer Kit could contain something useful, but to tell you the truth I haven't checked it out.
I can see the gesture recognition approach being very tricky though. There has to be a significant variation between the gestures, otherwise, taking into acount the Kinect low resolution and noise issues, even if you get a very large number of training samples, it could still fail. Imagine writing 'i' or 'l' for example. Or the difference between 'o' and 'a' (depending on your handwriting of course). The scale is so small and the moving of hands so trivial that I don't know if a classifier -even a powerful one- could catch that kind of variations.

C# XNA Network Game Without LIVE [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have made a game in C# with XNA. And I would like to make it playable online.
I want to be able to host a game on one machine and be able to connect to this game on other machines. Kinda like a listen server in Half Life.
This might seem like a pretty common problem that should have been solved a million times. But I have googled my ass off and i cant really seem to find any useful information.
I want to know exactly what I would need, concerning network-stuff, in order to create an online game with XNA, without using the microsoft-Live thingy.
A Library? the using-thing located in top of a class.
Code for initializing this stuff
How to look for another computer playing this game.
How to get/send data between the computers.
On which client are things calculated. If one guy would fire a bullet, should this bullet be created as an object on both clients? Or is one having the object,(checking for collisions etc.) and the other one just gets positions for draw?
I would like someone who has made a game like this to answer, what would be a standard approach.
The built-in XNA libraries are Live-focused, so you'll either have to live with that, or use a different network library.
The .NET UdpClient and Socket libraries are pretty straightforward.
Alternatively, have a look at the Lindgren open source network library. It includes some extension methods for sending XNA types like Matrix, Vector3, etc. which can be useful when you're getting started.
I wrote an answer for a question about making an MMO using lidgren, as mentioned above. It's got a few links to resources you can use to learn how to use it. I've used it personally to have a small test app with 5 users running around together, but I haven't taken it any further than that just yet.
Massive multiplayer in xna

What is the logic behind game coding, moving graphics simultaneously? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I was reviewing a code from a simple PONG game code in c#, the logic as far as I could understand was reading a key press (UP and Down) in a infinte loop and update the position of the ball and bar each n milliseconds one after another.
I want to know how to draw objects on a graphic box simultaneously?
I am just interested in making simple games using a imagebox and simple graohics.
If you want to make really simple games like Tetris or other puzzle-like, you could simply drop the "infinite loop" part. I've seen plenty of simple games built with Winforms/user controls/standard events (keypress/mousemove...).
If you plan to write something more complicated, then you probably want start learning XNA. Microsoft kindly provides useful starter kits.
You don't do it simultaneously, you do it in a loop but that loop happens so fast that a human cannot tell they are being updated one at a time.

Categories