
26 Kan. App.2d 902 (2000)
995 P.2d 905
STATE OF KANSAS, Appellee,
v.
DENNIS J. BROCKENSHIRE, Appellant.
No. 80,722.
Court of Appeals of Kansas.
Opinion filed January 21, 2000.
*903 Debra J. Wilson, assistant appellate defender, and Jessica R. Kunen, chief appellate defender, for appellant.
Frank E. Kohl, county attorney, and Carla J. Stovall, attorney general, for appellee.
Before JUSTICE LOCKETT, presiding, MICHAEL F. POWERS, District Judge, assigned, and ROBERT G. JONES, District Judge Retired, assigned.
LOCKETT, J.:
Defendant appeals convictions of two counts of sale of marijuana within 1,000 feet of a school and his sentences for those convictions. Because we have determined that the defendant is entitled to a new trial, we will discuss only three of the eleven issues raised in the appeal.
Dennis Brockenshire was originally charged with two counts of sale of marijuana within 1,000 feet of a school and two counts of no tax stamp. The sales were alleged to have occurred on March 15, 1996, and on March 27, 1996. Both buys involved a police informant, Henry Rairden, who was paid $25 for each purchase of marijuana.

March 15, 1996, Marijuana Transaction
On March 15, 1996, Rairden called the Leavenworth Police Department and told Detective Derek Burleson that Brockenshire was at Rairden's mobile home wanting to sell him marijuana. Burleson met with Rairden, patted him down, briefed him, gave him a body wire and taping device, and provided him $80 for the buy. Burleson followed Rairden to the entrance of the mobile home park where he set up surveillance. Due to the surroundings, Burleson was unable to see Rairden's mobile home from his position at the entrance of the park. Rairden was gone approximately 30 minutes.
While Rairden was in his mobile home, Burleson saw Dan Stillian drive up and park outside Rairden's mobile home. Brockenshire went to Stillian's truck. Stillian left and returned a short time *904 later. Brockenshire again met Stillian at his truck. When Brockenshire returned to Rairden's mobile home, he gave Rairden a quantity of marijuana. Rairden left his mobile home and turned the marijuana over to Burleson.

March 27, 1996, Marijuana Transaction
On March 27, 1996, Rairden again contacted Burleson regarding a marijuana buy from Brockenshire. Burleson and Rairden repeated the same procedures implemented on March 15, 1996, with the exception that on this transaction, Rairden was given $75 for the buy. Rairden waited with Brockenshire at Rairden's mobile home until Stillian drove up. As before, Brockenshire met with Stillian in the truck, returned to Rairden's mobile home with marijuana, and gave it to Rairden. Rairden turned the marijuana over to Burleson.

Procedural History of the Case
The Stated charged Brockenshire with the sale of marijuana within 1,000 feet of a school and no tax stamp in separate complaints filed on May 8, 1996. Later, the State amended the complaints by dismissing the no tax stamp charges. The complaints were consolidated for trial. Brockenshire was found guilty of both charges of sale of marijuana within 1,000 feet of a school. Brockenshire appeals his convictions and the sentences imposed, raising numerous issues.

ACCESS TO A LAW LIBRARY
One week after the complaints were filed, Brockenshire, who was held in the county jail, advised the judge that he intended to represent himself. Brockenshire then asserted that because the county jail in which he was incarcerated did not allow prisoners who represented themselves to have law books or access to a law library, he was being denied his constitutional right to access to a law library. The judge stated Brockenshire would be provided access to law books through a court-appointed attorney who would represent him at no cost. Brockenshire refused to accept a court-appointed attorney to represent him.
*905 On June 18, 1996, Brockenshire, by written notice, asserted his right of self-representation. In addition, Brockenshire requested the court to grant him access to an adequate law library. At a hearing on September 25, 1996, Brockenshire again informed the judge that he would represent himself and requested that he be granted access to a law library. The judge responded, "If you decide you need a lawyer [to represent you], let me know. I am not going to play games with you."
At the preliminary examination Brockenshire, representing himself, objected to the proceeding because he had not been given access to law books. The judge advised Brockenshire to file a motion. At the conclusion of the preliminary examination, Brockenshire was bound over for arraignment and trial. At a pretrial conference on November 13, 1996, Brockenshire, representing himself, again requested he be provided access to a law library. The State argued that Brockenshire would have access to research material if he accepted court-appointed counsel to represent him. Brockenshire expressed to the judge his distrust of an attorney who would be paid by the State. He asserted that the right to represent oneself entails an entitlement to access a law library. The judge denied the motion. At some point prior to trial, Brockenshire accepted a court-appointed attorney as co-counsel. Brockenshire was convicted of both charges.
In his appeal, Brockenshire contends that the trial court's refusal to grant him access to a law library denied him the right to effective self-representation and forced him to accept unwanted legal counsel in order to obtain access to legal resources to prepare for trial.
In Bounds v. Smith, 430 U.S. 817, 52 L. Ed.2d 72, 97 S. Ct. 1491 (1977), the United States Supreme Court considered an appeal by prison inmates who claimed that they were denied access to law libraries or legal assistance to challenge their sentences and conditions of imprisonment. The Bounds Court held that "the fundamental constitutional right of access to the courts requires prison authorities to assist inmates [who are not entitled to court-appointed counsel] in the preparation and filing of meaningful legal papers by providing prisoners with adequate law libraries or adequate assistance from persons trained in the law." 430 U.S. at 828.
*906 The issue of adequate self-representation by prison inmates was revisited by the United States Supreme Court in Lewis v. Casey, 518 U.S. 343, 135 L. Ed.2d 606, 116 S. Ct. 2174 (1996). In Lewis, the Court emphasized that Bounds did not establish a right to a law library or to legal assistance; the right acknowledged in Bounds was the right of prison inmates who represented themselves of access to courts. 518 U.S. at 350. The Lewis Court stated: "[P]rison law libraries and legal assistance programs are not ends in themselves, but only the means for ensuring `a reasonably adequate opportunity to present claimed violations of fundamental constitutional rights to the courts.'" 518 U.S. at 351. Bounds and Lewis require prison authorities to provide inmates the legal tools needed to directly or collaterally attack their sentences and to challenge the conditions of confinement. The Court concluded that inmates who alleged a violation of the right of access to courts were required to show actual injury to succeed.
Following Bounds, federal circuit courts have determined that prison inmate rights are not unlimited and that a prisoner who knowingly and voluntarily refuses appointed representation by counsel in a criminal proceeding is not entitled to access to a law library. Degrate v. Godwin, 84 F.3d 768 (5th Cir. 1996) (a prisoner who knowingly and voluntarily waives appointed representation by counsel in a criminal proceeding is not entitled to access to a law library); United States v. Smith, 907 F.2d 42, 45 (6th Cir.) (State does not have to provide access to a law library to defendants who wish to represent themselves), cert. denied 498 U.S. 986 (1990); United States ex rel George v. Lane, 718 F.2d 226, 233 (7th Cir. 1983) (State was not required to offer a defendant law library access once it offered the defendant assistance of counsel, which the defendant declined); United States v. Wilson, 690 F.2d 1267, 1271 (9th Cir. 1982) (a prisoner's Sixth Amendment right to self-representation does not include a right to conduct research at the government's expense), cert. denied 464 U.S. 867 (1983); Kelsey v. State of Minn., 622 F.2d 956, 958 (8th Cir. 1980) (holding that prisoner's constitutional right of access to courts did not obligate officials to provide him with an adequate law library where alternative means of satisfying access to courts were available).
*907 If Brockenshire rejected a court-appointed counsel to assist in his preparation for trial, he had no constitutional right of personal access to a law library in preparing for his criminal trial.
A defendant's right to represent himself or herself does not obligate officials to provide a defendant held in custody pending trial access to a law library, where alternate means are available. When a defendant alleges a violation of his or her right to effectively represent himself or herself, the defendant is required to show actual injury to that right.
The record is unclear as to the time or the conditions imposed when Brockenshire accepted court-appointed co-counsel. At some point Brockenshire accepted co-counsel to assist him in preparation for trial. At that time he had access to all the legal resources necessary through court-appointed co-counsel, and he retained control of his case.
After reviewing the trial record, we are aware that at trial Brockenshire had co-counsel to assist him and that Brockenshire exercised control and direction of his defense. Brockenshire objected, made arguments to the court, presented evidence, and cross-examined witnesses during the trial. Although Brockenshire alleges his right to effectively represent himself was denied, he has not shown an actual injury to that right.

Right to be Present
Brockenshire next contends that the judge erred in conducting a competency hearing pursuant to K.S.A. 22-3302(1) without him being present at the hearing.
Brockenshire was in custody after his arrest. On May 15, 1996, after a brief hearing at which the Assistant County Attorney and Brockenshire were present, and at which Brockenshire represented himself, the district judge set a date for the preliminary examination. After Brockenshire was taken from the courtroom, Brockenshire's mother expressed to the judge her concerns as to Brockenshire's competency. Brockenshire's mother approached the bench, stating:
"(DEFENDANT'S MOTHER): I have come up here because [Brockenshire] can't remember dates and he has a learning disability.

*908 "THE COURT: Does he have a history of mental problems?
"(DEFENDANT'S MOTHER): He can only read and write about the fourth grade level, and the last attorney he had told me he was mentally about sixteen.
"THE COURT: In his problem with other states, has he had a psychological evaluation or anything in school?
"(DEFENDANT'S MOTHER): No.
"THE COURT: Do you feel he might need one?
"(DEFENDANT'S MOTHER): I know he can't read that well. He can read the law now because in prison he wanted to help himself, and he embarrasses me sometimes.
"THE COURT: I want to get him an attorney. If he won't accept one, I can't force him to take one, that's the problem.
"(DEFENDANTS MOTHER): I want to help him.
"THE COURT: I want to do that too. He won't let me do that.
"(DEFENDANTS MOTHER): That's what he told me at the beginning.
"THE COURT: I wonder if we shouldn't have a mental evaluation done.
"(DEFENDANTS MOTHER): I would like that, but I don't want him to get mad at me."
The court's journal entry states that on May 15, 1996, the case came on for hearing for a determination of Brockenshire's competency to stand trial. The journal entry incorrectly stated: "[T]he Defendant appears in person and waives his right to counsel." The judge ordered that Brockenshire be evaluated at Northeast Kansas Mental Health and Guidance Center in Leavenworth, Kansas, but he refused to cooperate in this evaluation.
A June 5, 1996, a journal entry ordered a competency evaluation of Brockenshire at Larned State Hospital. The journal entry states that the matter "comes on for hearing the State's Motion for Evaluation to Determine Competency. The State appears by its attorney, Michael Gibbens, Assistant County Attorney, the Defendant waives his right to counsel." There is no transcript or record of this hearing in the appellate record or court file.
When Larned State Hospital found Brockenshire competent to stand trial, he was returned to court. At a subsequent hearing in the district court, Brockenshire claimed that because he was neither notified nor present in court when the judge ordered that he be evaluated to determine his competency to stand trial, the *909 charges against him must be dismissed. Brockenshire stated to the judge:
"Yes, Your Honor. I was denied my constitutional right to be present at a material stage of my trial when you conducted the hearing to send me to Larned out of my presence, and I didn't receive a copy of the motion to have the hearing, which I was entitled to, being I am representing myself. And, furthermore, under Subdivision [22]-3302, it states the defendant must be present at all proceedings under this section, and which is under the section that you sent me up there for. I had a right to be at that hearing, and, therefore, I am requesting a dismissal on the grounds that this is a delay that caused almost four months delay, which pointed to the people, and a violation of my speedy trial rights and right to be present."
Without addressing his complaint, the judge reviewed the Larned evaluation and found Brockenshire competent to stand trial. After the hearing, Brockenshire filed a motion to dismiss the charges against him, claiming a denial of his constitutional right to be present at a material stage of trial.
After the conclusion of the preliminary examination, Brockenshire again objected to having been committed for a competency evaluation without notice and without the opportunity to be heard. Without responding to the defendant's objection, the judge bound Brockenshire over for trial.
At a pretrial conference, Brockenshire again renewed his motion for dismissal. This time the judge responded, stating:
"Once the question of the defendant's competency is raised, the Court has to order an evaluation be conducted. Really wasn't any hearing to hold, nor could the Court have entertained arguments from the defendant, who is representing himself at that point. Therefore, the court will deny the motion to dismiss."
On appeal, Brockenshire asserts that he was prejudiced by the delay. Brockenshire argues that the delay caused by the competency evaluation resulted in the loss of a critical defense witness, Dan Stillian, who had been charged with sale of marijuana. The charge against Stillian had been dismissed for lack of probable cause. According to Brockenshire, Stillian left the jurisdiction of the court during the delay caused by the improper evaluation.
K.S.A. 22-3302(1) provides that if at any time after a defendant is charged with a crime the court finds reason to believe the defendant *910 is incompetent, the proceedings shall be suspended and a hearing conducted to determine competency. Subsection (7) of 22-3302 requires that the defendant be present personally at all proceedings under that statute.
The right of a defendant to be present at all proceedings to determine whether to hold a competency hearing has been discussed in several cases. State v. Baker, 236 Kan. 132, 137, 689 P.2d 803 (1984), held that an in-chambers conference to discuss defendant's difficulty in understanding proceedings was not a competency hearing requiring the personal presence of the defendant. Relying on Baker, this court held in State v. Perkins, 248 Kan. 760, 770, Syl. ¶ 6, 811 P.2d 1142 (1991), that K.S.A. 22-3302 does not require that the defendant be present when the discussion concerns whether to hold a competency hearing.
The proceeding to determine whether to order a competency evaluation pursuant to K.S.A. 22-3302(1) is not a critical stage of the prosecution that requires the defendant's presence under the Sixth Amendment. Neither the Constitution nor the statute requires that the defendant have counsel to represent him or her at the proceeding. Therefore, Brockenshire's Sixth Amendment right was not violated by the fact he was not present at the proceeding to determine if a competency evaluation was required.

MANNER TAPE RECORDINGS ADMITTED
Cassette tape recordings from the body wire worn by Rairden during the two marijuana transactions were admitted into evidence over the objection of Brockenshire. To present a foundation for the tape's admission into evidence, Detective Burleson testified that he supplied Rairden with a taping device and then received the tapes from Rairden after the drug transactions. When asked on direct examination if he could identify the tape as the same recording he received from Rairden on March 27, 1996, Burleson testified:
"Yes. This is the container that I put the tape in and sealed the evidence tape. The evidence tape has been broken, not by me. This was checked out to the defense. So my seal has been broken. I would only assume that this is the same tape in here." *911 Brockenshire contends on appeal that the trial court erred in the admission of the tapes because they were admitted without sufficient foundation.
Brockenshire objected to the admission of the tapes and the lack of foundation, stating:
"Object to admission of the tapes .... Furthermore, Henry Lee Rairden never testified to the fact that is my voice on that tape. And he, the voice, what is on it, what is actually on the tapes has not been introduced into evidence, and there is no chain of evidence to show that's my voice on that tape. Nobody ever played that tape and stated, yes, that's our conversation. It hasn't been admitted into evidence."
Although admitted into evidence for the jury's consideration during deliberations, the tapes were not played in open court.
Brockenshire contends that the trial judge's refusal to play the tapes in open court violated his Sixth Amendment right to confront evidence and the witnesses against him; his Fourteenth Amendment right to due process; and the K.S.A. 22-3405 statutory right of the accused to be present at every stage of the trial.
The admission of evidence lies within the sound discretion of the trial court. State v. Lumley, 266 Kan. 939, 950, 976 P.2d 486 (1999). The foundation requirements for admission of a tape recording are set forth in State v. Williams, 235 Kan. 485, 491, 681 P.2d 660 (1984):
"`The cases are in general agreement as to what constitutes a proper foundation for the admission of a sound recording, and indicate a reasonably strict adherence to the rules prescribed for testing the admissibility of recordings, which have been outlined as follows: (1) a showing that the recording device was capable of taking testimony; (2) a showing that the operator of the device was competent; (3) establishment of the authenticity and correctness of the recording; (4) a showing that changes, additions, or deletions have not been made; (5) a showing of the manner of the preservation of the recording; (6) identification of the speakers; and (7) a showing that the testimony elicited was voluntarily made without any kind of inducement.' [Citation omitted.]"
Burleson's testimony was the foundation for the admission of the tapes. Burleson could "only assume" that the tapes admitted into evidence were the tapes he gave Rairden to record the drug buys.
*912 First, the tapes were admitted into evidence without proper foundation. Second, the tapes were not played in open court but were played only in the jury room; under these circumstances Brockenshire was denied the opportunity to comment or rebut the evidence contained in the tapes. Brockenshire's lack of opportunity to confront the evidence in the presence of the jury was in contravention of his Sixth Amendment right of confrontation.
The admission or exclusion of relevant evidence in a criminal case is governed by two rules, the harmless error rule and the federal constitutional error rule. Error in the admission or exclusion of evidence by the court is not grounds for granting a new trial or setting aside a verdict unless refusal to take such action appears to the court inconsistent with substantial justice. At every stage of the proceeding, the court must disregard any error or defect in the proceeding which does not affect the substantial rights of the parties. K.S.A. 60-261. When reviewing the erroneous admission or exclusion of evidence, the error is harmless if no substantial right of the defendant is involved. State v. Sanders, 258 Kan. 409, 418, 904 P.2d 951 (1995).
The Sixth Amendment to the United States Constitution gives a criminal defendant the right to be confronted with the witnesses against him or her. Coy v. Iowa, 487 U.S. 1012, 1015, 101 L. Ed. 2d 857, 108 S. Ct. 2798 (1988). Subject to certain exceptions not applicable to this case, the Confrontation Clause guarantees the defendant the right to physically confront those witnesses who will testify against him or her in a face-to-face meeting before the trier of fact. 487 U.S. at 1016.
An error of constitutional magnitude is serious and may not be held to be harmless unless the appellate court is willing to declare a belief that it was harmless beyond a reasonable doubt. Thus, before we may declare the error harmless, we must be able to declare beyond a reasonable doubt that the error had little, if any, likelihood of having changed the result of the trial. State v. Bell, 266 Kan. 896, 920, 975 P.2d 239 (1999).
The State has cited no authority for allowing a jury to consider evidence admitted outside the presence of the defendant. We are unable to declare beyond a reasonable doubt that this error had *913 little, if any, likelihood of having changed the result of the trial. Therefore, Brockenshire's convictions are reversed.
Reversed and remanded for a new trial.
