Click here to Skip to main content
15,895,370 members
Home / Discussions / C#
   

C#

 
QuestionUpdate requires a valid UpdateCommand when passed DataRow collection with modified rows. [modified] Pin
astrovirgin7-Oct-08 23:36
astrovirgin7-Oct-08 23:36 
AnswerRe: Update requires a valid UpdateCommand when passed DataRow collection with modified rows. Pin
Giorgi Dalakishvili8-Oct-08 0:23
mentorGiorgi Dalakishvili8-Oct-08 0:23 
AnswerRe: Update requires a valid UpdateCommand when passed DataRow collection with modified rows. Pin
nelsonpaixao8-Oct-08 12:47
nelsonpaixao8-Oct-08 12:47 
QuestionProblem with free up memory! Pin
Ha ha ha ha ha ha ha ha7-Oct-08 23:24
Ha ha ha ha ha ha ha ha7-Oct-08 23:24 
AnswerRe: Problem with free up memory! Pin
Simon P Stevens8-Oct-08 0:11
Simon P Stevens8-Oct-08 0:11 
GeneralRe: Problem with free up memory! Pin
leppie8-Oct-08 1:53
leppie8-Oct-08 1:53 
GeneralRe: Problem with free up memory! Pin
Ha ha ha ha ha ha ha ha8-Oct-08 1:54
Ha ha ha ha ha ha ha ha8-Oct-08 1:54 
GeneralRe: Problem with free up memory! Pin
Simon P Stevens8-Oct-08 3:06
Simon P Stevens8-Oct-08 3:06 
I've never used directsound (I'm assuming that is what you are using), so I'm not entirely sure about all of this.

With 1 - The problem is likely to be that you are disposing of the buffer before it has a chance to do any playback.

With 2 - The problem is likely to be that you are calling play() while the buffer is still busy playing the previous bit (I'm assuming the play method is asynchronous). Hence it cuts.

What you probably need to do is remove the call to Play(). You need to track how much is in the buffer. When there is more than 5 seconds of data in the buffer, call play, and set a flag to prevent it calling play again. When the buffer runs out, clear the flag, and allow play to be called again when the buffer fills back up to the 5 second mark. This way you prevent play from being called repeatedly while the buffer is still playing, and you also prevent it from being called when there is only a small amount of data in the buffer.

if (!isPlaying && timeInBuffer > 5)
{
    buffer.Play();
    isPlaying = true;
}
else
{
    isPlaying = // Check if buffer has finished playing
    timeInBuffer = // Check the amount of time left in the buffer
}


Simon

GeneralRe: Problem with free up memory! Pin
Ha ha ha ha ha ha ha ha8-Oct-08 3:51
Ha ha ha ha ha ha ha ha8-Oct-08 3:51 
GeneralRe: Problem with free up memory! Pin
Simon P Stevens8-Oct-08 4:42
Simon P Stevens8-Oct-08 4:42 
GeneralRe: Problem with free up memory! Pin
DaveyM698-Oct-08 5:58
professionalDaveyM698-Oct-08 5:58 
GeneralRe: Problem with free up memory! Pin
Simon P Stevens8-Oct-08 22:58
Simon P Stevens8-Oct-08 22:58 
GeneralRe: Problem with free up memory! [modified] Pin
Mark Salsbery8-Oct-08 8:07
Mark Salsbery8-Oct-08 8:07 
GeneralRe: Problem with free up memory! Pin
Ha ha ha ha ha ha ha ha9-Oct-08 20:50
Ha ha ha ha ha ha ha ha9-Oct-08 20:50 
QuestionGet a whole column in a matrix Pin
xkrja7-Oct-08 21:37
xkrja7-Oct-08 21:37 
AnswerRe: Get a whole column in a matrix Pin
User 66587-Oct-08 21:48
User 66587-Oct-08 21:48 
QuestionHow to get whitespace in xml Pin
manju#1237-Oct-08 19:52
manju#1237-Oct-08 19:52 
AnswerRe: How to get whitespace in xml Pin
Pedram Behroozi7-Oct-08 20:18
Pedram Behroozi7-Oct-08 20:18 
GeneralRe: How to get whitespace in xml Pin
manju#1237-Oct-08 20:23
manju#1237-Oct-08 20:23 
GeneralRe: How to get whitespace in xml Pin
Pedram Behroozi7-Oct-08 20:29
Pedram Behroozi7-Oct-08 20:29 
GeneralRe: How to get whitespace in xml [modified] Pin
manju#1237-Oct-08 20:57
manju#1237-Oct-08 20:57 
GeneralRe: How to get whitespace in xml Pin
Pedram Behroozi7-Oct-08 22:47
Pedram Behroozi7-Oct-08 22:47 
GeneralRe: How to get whitespace in xml Pin
Ashfield7-Oct-08 23:10
Ashfield7-Oct-08 23:10 
GeneralRe: How to get whitespace in xml Pin
leppie7-Oct-08 23:46
leppie7-Oct-08 23:46 
GeneralRe: How to get whitespace in xml Pin
Pedram Behroozi7-Oct-08 22:53
Pedram Behroozi7-Oct-08 22:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.